Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

cinemachine freelook prefabs seem to become corrupted

Discussion in 'Cinemachine' started by mradfo21, May 24, 2018.

  1. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    140
    Cinemachine freelook cameras seem to have alot of trouble keeping their settings when saved as prefabs. I cant exactly figure out what corrupts their data. But the Top Rig, Middle Rig, Bottom Rig settings seem to get corrupted and reset every now and then. I can tell when this happens too as the arrow next to them disappears

    upload_2018-5-24_11-37-31.png

    when I select one of the corrupted rigs
    upload_2018-5-24_11-38-1.png

    i see this appear in the object heirarchy

    upload_2018-5-24_11-38-19.png


    the ONLY way to keep them for sure is to save via unity collaborate and constantly revert them after working in the project ... man.. what a nightmare
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,231
    oh really ?!
    what version of Unity?
     
  3. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    140
    2018.1.0f1
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,231
    trying to repro... can't seem to do it. Any thoughts on what kind of things you're doing in the editor that might make it happen?
     
  5. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    140
    hehe its slowly corrupting them more and more

    upload_2018-5-24_13-32-54.png

    so i'm not sure. I do have some editor scripts that are running update methods and I do have an

    [InitializeOnLoad]

    that automagically spawns some gameobjects and prefabs into the scenes (but not the cameras).

    I'm not sure but i'll keep testing and see if i can find a pattern
     
  6. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    140
    luckily collaborate's revert is saving me
    upload_2018-5-24_13-36-0.png
     
  7. Feriluce

    Feriluce

    Joined:
    Nov 28, 2013
    Posts:
    5
    I have a very similar, if not the same, problem. I have created a prefab with cinemachinefreelook on it, and it seems that whenever I try to change settings on that prefab, it spawns those 3 rigs in the scene, tries to parent them to the prefab, which fails, and then throws this nullreferenceException.

    Error.png
     
  8. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    140
    hurrah! im not crazy!
     
  9. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,231
    I really can't repro this!
    Can you tell me which version of Unity, which version of CM, and what exactly are the steps to reproduce?
    I've tried changing all sorts of settings but it refuses to misbehave.
     
  10. Feriluce

    Feriluce

    Joined:
    Nov 28, 2013
    Posts:
    5
    I'm using unity 2018.1.0 and Cinemachine 2.1.13, but I just tried to reproduce it myself, and now it doesn't happen for me either.
    It seems like the problem was in creating the prefab though. When I tried creating new prefabs this time, the 3 child rigs were created underneath the prefab. That didn't happen with the prefab that was broken. That one was just a single object, which I assume is why it kept trying to create the missing rigs.
     
  11. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    140
    Ok here's how I think you repro this. Make a cinemachine prefab out of a free look. Instantiate it at runtime. Make changes to it. Drag that to make a new prefab on disc. Then drag the camera ontop of the original prefab to replace its settings.

    Now you'll start to see TopRig, MiddleRig, and BottomRig appear in the heirarchy of the game. This means your F***ED. Cinemachine is now destroying your cameras.

    Restart Unity and you'll be greeted with this:

    upload_2018-6-22_17-7-1.png

    Not having the arrows next to your camera is BAD NEWS.

    When you run the game cinemachine will make have erased all your rig settings and there's no way to get them back outside of version control.


    Now this could ALLLLL be avoided if you could actually copy the rig settings during runtime and paste them onto the prefab on disc like every other object in unity. I know you'd mentioned this was working but it does not sadly.
     
  12. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,231
    Not sure exactly what you mean by that last step.
    After making the second prefab, if I drop my FreeLook from the hierarchy onto the prefab, all is fine, the settings get copied. If I try to drag the second prefab onto the first prefab, I get this:

    upload_2018-6-24_8-13-13.png

    If I click Yes, then click on the profab, then the Top, Middle, and Bottom rigs from the prefab get moved to the hierarchy, and the prefab is broken.

    Is that consistent with what you're seeing?


    If I do this on the FreeLook in the hierarchy:
    upload_2018-6-24_8-27-47.png

    Then this on the FreeLook in the prefab:
    upload_2018-6-24_8-28-32.png

    Then it works perfectly.
    How are you doing it differently?