Hi. So I'm trying to animate a character based on a position of an object. My character has an animator controller with forward, backward, and strafing movements. A typical multi-directional movement system (2D Freeform Directional).
So what I'm doing is using a 'Get Position > Self' in both X and Z of that object. The object does fluctuate slightly, so it might start at an X: 0.135 and a Y: -0.0214, etc. but fluctuate by .1 or .2 in +- on X and Z.
Ideally what I would like to do is if the object in X is equal to or greater than 0.5, then start my characters forward movement by using a 'Set Animator Float'. But what I need is when X is at 0.5 then the set the Animator variable called 'Forward' to 0.1 so the character is slightly moving. And if X is 1.0 for example, have 'Forward' be at 1.0.
Because the object isn't centered at 0,0 and fluctuates, I need to adjust for that. I also would like this all in one state so multiple 'Set Animator Float' Actions can be use for all directions.
So I'm trying to figure out all the Actions I need to accomplish this:
'Get Position > Self' so I know the starting X and Z of the object.
An Action(s) that says if X is 0.5 then set float in animator to 0.1. If X is 1.0 then set float in animator to 1.0.
Any thoughts would be helpful. Thanks!