- Home /
Question by
Jotakuun · Oct 27, 2014 at 04:15 PM ·
animatorvariableintparameters
Set an Int variable to an animator parameter
Hello UnityCommunity!
I have an integer variable and I need to set it to an animator parameter, but I don't know exactly how.
This is my variable:
var comboCount : int = 0;
And I want to set this variable to an animator parameter, how can I do it?
Thanks you!
Comment
http://docs.unity3d.com/$$anonymous$$anual/AnimationParameters.html
I already have seen that link and doesn't specify nothing.
Best Answer
Answer by Josh Naylor · Oct 27, 2014 at 04:18 PM
In the Documentation that Sara linked you'll see the line
animator.SetBool("Jump", true );
change that to be
animator.SetInteger(string name, int value);
It does specify if you read the line "Parameters can be assigned values from a script using functions in the Animator class: SetFloat, SetInt, and SetBool."