Search Unity

Animator without Animations for State-Driven Cameras

Discussion in 'Cinemachine' started by tjmaul, May 3, 2019.

  1. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    467
    Hi everybody,

    In my game, the camera changes between some camera angles and behaviours, tied the gameplay state. I tried to model this with the the built-in Animator, since I can define states and transitions easily and it integrates well with the State-Driven Camera of Cinemachine.

    However, since I don't have actual animations bound to the animator (
    Motion
    property is
    None
    ), the states seem to default a play time of 1 second, which means that in the worst case, the state change happens only 1 second after whatever event caused it. I'd like the state to change instantaneously after a transition is triggered and not wait for the (non-existent) motion cycle to finish.

    Am I missing anything or am I going the wrong way? I do realise that I kinda misuse the Animator for this.

    What I already tried is to fiddle with the transition settings, but only found increasing the playback speed of the state to very high numbers mitigates the effect. However, this seems like a very hacky solution.

    If any of the cinemachine devs are reading this:
    I'm really enjoying using Cinemachine, really takes some workload off me and brings very nice results! Thanks!
     
  2. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    You just need to uncheck "Has Exit time", and your transition will happen whenever your conditions are all true
     
    tjmaul likes this.
  3. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    467
    Thanks, DavidGeoffroy, now I feel somewhat stupid. I could have sworn I tried this!
    Anyways, this works like a charm!