Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Prefabs Breaking Between Levels and Builds

Discussion in 'AR/VR (XR) Discussion' started by Radius, Jul 17, 2015.

  1. Radius

    Radius

    Joined:
    May 11, 2013
    Posts:
    51
    Hi, I posted this on the oculus forums, no reply as yet, so I imagine this might be more unity thing.

    Here is what is happening.

    I have a Unity FPS controller, arms with weapon parented to it, then a game object at the end of the weapon that spawns my projectiles. All of this is guided by head position etc.

    This is a prefab dropped in multiple levels.

    It works perfectly most of the time through all levels.

    When I build a version of the game with multiple levels, say 4 or 5. It will only work correctly on 1 of the levels, and that is also random, it could be any level that it chooses.

    When it breaks head movement no longer guides the direction of the projectile spawner so you effectively can't aim anymore.
    Really giving me a lot of trouble at the moment, I wonder if anyone has any ideas?.

    using latest runtime and unity 5.1 with VR mode enabled, standard assets not OVR or anything.

    I can send along 2 example builds that show the issue if that helps. Thanks so much.

    EDIT - Just to be sure I just got the latest unity patch 5.1.1p4 and upgraded everything. Same issue.
    EDIT2 - This also happens when switching weapons, if weapon 1 is initially working and I switch to a new weapon, things break, switch back to first weapon, now broken also.

    Here is a video of things working correctly, not that it helps, but you can see how it should behave. I'm using my eyeline / head movement to aim + jump etc. works well.

     
  2. Radius

    Radius

    Joined:
    May 11, 2013
    Posts:
    51
    Hi, just updated to 5.1.2 to see if this fixed the issue and no luck:( still there.
    Just submitted a bug report 713029.
    Thank you
     
  3. Radius

    Radius

    Joined:
    May 11, 2013
    Posts:
    51
    Since I have not heard anything on this, I wanted to add two things I have observed since.

    1. Playing direct from the editor works every time correctly. It's when I build that things break with head tracking.
    2. If I make a build with multiple levels and the first level does not contain my prefab, eg just a static camera without a controller, the level after that works correctly and then the rest break.
     
  4. JohnBon

    JohnBon

    Joined:
    Jul 21, 2015
    Posts:
    6
    yeah, got fixed with new update
     
  5. EdBlais

    EdBlais

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    303
    This might be fixed in 5.1.2p1. I've added a fix to reset all camera transforms when DeviceType changes or when VR switches from enabled to disabled or reverse. Please try with that, but it may not work. If not, we will continue to look into your issue (I replied to the bug report as well). I also have a transform fix coming down the pipeline for DontDestroyOnLoad objects in the scene. That will be included in p2.
     
  6. Radius

    Radius

    Joined:
    May 11, 2013
    Posts:
    51
    Thank you Ed, that sounds great I will try this out when the new patch is here and let you know either way. Thanks again for looking into this:)
     
  7. Radius

    Radius

    Joined:
    May 11, 2013
    Posts:
    51
    I tried the new patch today, did not fix my issue unfortunately.
    Since this problem has stopped me from progressing anywhere, I tried to track it down more and I think i have it.

    I can repro this 100%, every time. It involves saving and opening levels. So since it's a long explanation I made a video of this. Hope it helps as it relates to VR and head position tracking. Seems that when I save and open levels things break and that would also explain why they don't work correctly when building multiple levels?.

    Anyway here is what is happening.
     
  8. Radius

    Radius

    Joined:
    May 11, 2013
    Posts:
    51
    Forgot to add that the temporary fix I found was to duplicate a broken game object, then everything is working, but If I close a level and re open it's all broken again. With 20 or so levels this is driving me nuts this bug.
     
  9. Radius

    Radius

    Joined:
    May 11, 2013
    Posts:
    51
    I added a bug report for this, but included my entire project this time.
    714613
     
  10. Radius

    Radius

    Joined:
    May 11, 2013
    Posts:
    51
    I wanted to check in and see if there are any thoughts on this? Still an issue for me each day working.
    Thanks