Search Unity

Cinemachine does not return camera back after playmode

Discussion in 'Cinemachine' started by goodguy, May 9, 2018.

  1. goodguy

    goodguy

    Joined:
    Jul 21, 2012
    Posts:
    18
    Hi!
    I want to make cinemachine virtual camera to simply follow a character in a game. Everything works fine except for one thing. After I set Follow Target and Aim at, the camera looks at what I need. Then I hit play and test everything. But after I stop playmode the camera goes to 0:0 position but not where it was before the play mode. Look at the screenshot. I got "save during play" disabled.
    It's driving me crazy already. It's very hard to tune the scene up when I can't see where the camera should look. What am I missing with this SDK? Is it possible to make the camera always go back to the position I set after the play mode? I'm not sure but it looks like a bug. The interesting thing is that it starts to point where I want after I hit play again and then quickly stop play mode.
     

    Attached Files:

    Last edited: May 9, 2018
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    The vcam will always position itself in relation to the follow target, because that's what you told it to do. The actual value you put in the vcam's transfom is irrelevant - it will move itself to follow the target.
     
  3. goodguy

    goodguy

    Joined:
    Jul 21, 2012
    Posts:
    18
    Read my question more carefully, please. I position the camera relatively to the target and set all values. Everything's good up to this point. Then I hit play. But after I stop the play mode, the camera pays no attention to the follow target and puts itself to the world's 0:0:0 position (even though the follow target and aimat variables are still set, as you may see on my screenshot). At this moment if I hit play for at least a moment and stop the play mode, the camera like catches it's target and points where it's expected.
    I've noticed that it doesn't happen if I change the camera's update method from SmartUpdate to FixedUpdate. Maybe I just misunderstand how it all works. This doc says SmartUpdate updates according to how target updates, so I suppose that when I stop the play mode, the target does not update anymore and the camera can't catch its position. But how does it do it when I first set Follow Target and Aim To variables if the target is also not updating at this moment. It really looks like a bug to me
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Since I don't know how you're animating your target, it's difficult for me to answer this question. Could you put together a small sample project that shows this problem and send it to me?