#Adding time delay to the 3D animation in Unity

1 messages · Page 1 of 1 (latest)

opal cliff
#

Hi Everyone,
Consider we have 3d avatar model and animations. I have added animation state (eg: Walk, Run) in Animator Controller. How can we switch two animation states by adding time delay in between animation states using C# script in Unity.

Can any please provide some suggestions to achieve it.

jade hamlet
#

anim.SetFloat("State", 1f, .5f);

The first Value is the parameter name.

The second is the new value to assign to the parameter.

The third is the smooth damp time between the current animation playing and the next one to be played.

I would consider reading the Unity docs for a better understanding.

Edited.

broken canyon
#

I would consider reading the Unity docs
Hmm
Makes me wonder where you got that method declaration from that you suggested.
Because according to the docs, Animator.SetBool() does either take int, bool or string, bool - even on the newest version (2023.3).
And besides, calling SetBool without an actual bool value (which you did), makes little sense.

I think you just may be confusing methods, though I'm not sure what method you may have been thinking of.
Edit: Perhaps you were thinking of CrossFade?

jade hamlet