Manual/script-AnimationWindowEvent #355
Replies: 3 comments
-
Comment by It is important to note that function called by an animation event is allowed to have a float, string, int, object reference, or an AnimationEvent object as its parameter. However, it cannot have a bool as a parameter. Any function with a bool as a parameter will simply not show up in the dropdown of the available functions on the animation event. |
Beta Was this translation helpful? Give feedback.
-
Comment by A small gotcha when blending animations is events wont trigger if the animations' blend weight is 50% or less. This is commonly noticed when adding an OnComplete event on the last frame. Consider making a custom StateMachineBehaviour or a coroutine to wait the duration of the animation clip. |
Beta Was this translation helpful? Give feedback.
-
🛠️ Practical Use public void HandleEvent(AnimationEvent evt) {
Debug.Log("Float value: " + evt.floatParameter);
Debug.Log("String value: " + evt.stringParameter);
// and so on...
} This lets you pass richer data to your animation-triggered functions without breaking Unity’s one-parameter rule. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Manual/script-AnimationWindowEvent
https://docs.unity3d.com/Manual/script-AnimationWindowEvent.html
Beta Was this translation helpful? Give feedback.
All reactions