I'm trying to Drive a character's animator parameters with AC Global variables and so far I haven't found a nice solution through action lists.
The idea is that my character has 3 float parameters, and I would like these to match 3 global variables that I am setting when using items on the player character. I plan on having many different items to set these values, so I would like a system to pass the variable directly to the animator, rather than having to do a check then set for every possible value.
Am I missing something obvious here or will this require some code?
Comments
AC.GlobalVariables.GetFloatValue (2);
(Replace "2" with the ID number of the variable in question)
You can set this to an animator's parameter with:
float myFloatValue = AC.GlobalVariables.GetFloatValue (2);
Animator myAnimator = GetComponent <Animator>();
myAnimator.SetFloat ("MyFloatParameter", myFloatValue);
If you place that inside the Update() method of a C# script attached to your Animator, it'll sync the values every frame.