Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Invisible prefab when using realtime reflections

Discussion in 'Scripting' started by Simba, Jul 20, 2014.

  1. Simba

    Simba

    Joined:
    Nov 8, 2010
    Posts:
    77
    I've encountered a very strange glitch, which would be really nice to find the cause of. When I add the RenderToCubemap script from the Unity Docs, my prefab doesn't render. Everything else does, and the prefab definitely still exists - all gizmos appear in the scene view and the camera follows it around as it should.
    If I remove the RenderToCubemap script from the prefab, and add a placeholder cubemap to replace what would be the render texture, everything works perfectly.

    I'm not so much interested in a fix as a reason why this happens - I'm curious. Since the RenderTexture generated by the script just replaces a Cubemap, it should function exactly the same as a normal cubemap... right?
    (Although any fixes you have would be helpful :D)

    My computer is a 2013 iMac, (fully capable of running all Unity effects that I've come across) and I'm running Unity 4.5.2 Pro Trial - the latest version afaik.

    If you want/need any extra information, just ask!

    As posted on Unity Answers yesterday:

    "I'm using the Unity Pro trial. Day 5: Adding realtime reflections to my prefabs.

    I have a vehicle that gets spawned at runtime, and is parented to a controller script. On one of a few renderers, I have attached the realtime reflection script from the Unity Docs (http://docs.unity3d.com/ScriptReference/Camera.RenderToCubemap.html) When I look at the object in the scene view, while setting it up, it looks gorgeous, and works perfectly

    When I run the game, the vehicle is invisible.

    Even meshes without the script attached - all gone from the screen. All gizmos show up as expected and nothing appears to be deleted, though. The vehicle even handles right. I can send a demo package to any who need it, I suppose, if it's needed.

    I have had zero experience with Pro until a few days ago... Any suggestions?"

    (Please excuse the mirror-posting - I'm just super curious and right now it seems UA might have been the wrong place to post)