Search Unity

Cinemachine not working after scene load

Discussion in 'Cinemachine' started by Adrgan, Jun 16, 2021.

  1. Adrgan

    Adrgan

    Joined:
    Apr 12, 2021
    Posts:
    2
    Hi, been trying to get the cinemachine to follow player after to next scene.
    i have use the public static player, instance it, and use dontdestroy on load function on the script so that the player and its function is carrying over to the next scene as well.

    i have even make the cinemachine and the camera a child object of the player so that it retains its function.
    but everytime i had loaded to scene 2. the camera/cinemachine doesnt follow the player. i have even tried to turn off x,y and z damping on the cinemachine.

    it works fine when i get back to the scene 1.

    any advice/solution really would be appreciated.

    thanks!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Can you make a simple repro project that shows this problem, and send it to me?
     
  3. Adrgan

    Adrgan

    Joined:
    Apr 12, 2021
    Posts:
    2
    Hi, was able to fix the follow player by using transform to set the position at the Start function + dont destroyOnLoad. i dont know why it worked but it works....now im currently trying to fix the cinemachine confiner, as i load a new scene. the polygon 2D value went empty after each new scene. currently trying to figure out a way or a script to somehow set the polygon 2D value to the Cinemachine confiner value at start function on each scene.
     
  4. TakumaSama

    TakumaSama

    Joined:
    Nov 29, 2019
    Posts:
    1
    Did you found any solution? This issue is also driving me crazy. I found that DontDestroyOnLoad objects can access to scene objects. How can I access to scene objects in scene 2?
    I'm trying to do a WonderBoy in MonsterWorld game alike. Thanks
     
    Last edited: Sep 4, 2022