Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How can i disconnect timeline track in script

Discussion in 'Timeline' started by GSaHaLa, Mar 11, 2023.

  1. GSaHaLa

    GSaHaLa

    Joined:
    Jul 27, 2018
    Posts:
    3
    I created a Timeline. I added an Animation Track,and add serval Override Track for it. Can i disconnet one track in script at runtime?How?
    I think i can do transition by diconneting other animations except the animation which i want to transit to.In Image, such as i want to transit from attack_light to jump,i may diconnet other override animation tracks .Or is there any better way to make transitions like node in Animator?
    Thank you.
     

    Attached Files:

  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    You could try muting an override track at runtime, but you might have to stop and restart the playable director (not sure) as it might have to regenerate the playable graph internally. So there might be a stutter. You might have to experiment.

    Normally Timeline is for things like a cut sequence - a predefined sequence to play though rather than something you dynamically change at runtime. If you want to do lots of blending etc between animation clips, that is what animation state machines are for. https://docs.unity3d.com/Manual/AnimationStateMachines.html. Is there a reason you want to use a Timeline instead of a statemachine?