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

Script inheriting Cinemachine Component Base automatically deletes my CameraBrain GameObject

Discussion in 'Cinemachine' started by JadeEmpire, Feb 3, 2019.

  1. JadeEmpire

    JadeEmpire

    Joined:
    Oct 26, 2016
    Posts:
    14
    Hi,

    I created 2 scripts, that use motion captured devices to move, one for aiming and one for the body.

    However, recently it has been starting to behave weird.

    At first I upgraded from Unity 2018.2.12 to 2018.3. I think I have reinstalled my cinemachine, but I didn't delete the old one first(which was the older version when it lived in the assets folder instead of package folder)

    My prefab got all wacked. My prefabs won't accept changes saying the scripts are missing, and the aiming script is saying that it is 'missing'. Even though my stage.body script is okay. Also there is a missing gameObject in the prefab that is called 'cm', which is just grayed out and I have never seen it before.


    I fixed all of it by deleting everything cinemachine related, including the script and re making all the prefabs....

    THEN. Now for some reason, if I have either of the script in the editor mode before entering game mode, it will delete the gameObject that has cinemachineBrain on it automatically.

    But if I manually spawn it afterwards, it won't happen.

    No bugs and whatsoever is being thrown??

    I'd like to know why and how I encountered both experiences. Including the old one where I got a ghost gameObject 'cm' and has every prefab corrupted in my project.

    kinda urgent so hope I could get some help soon. thanks!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Sounds like you messed up your project pretty badly. It's hard to tell exactly what's going on just from your description.

    What I would try:

    Restore the backup from before you upgraded CM, when everything was working.
    Then, upgrade CM properly:
    1. open empty scene,
    2. delete old CM from assets,
    3. install new CM from packman