- Home /
What is a way to use a value and return it back to zero?
Hi. I'm trying to animate my character to lean directionally (additive) just as he starts moving. The way to do this is obviously to get the movement axis (X and Z), as he moves in 3D space, but these two values must return to zero, even if input continues.
This "leaning" float value has to be an increment of sorts that is used only for a second as input is pressed, to determine the direction (used for the animator) and then to return it back to zero. How on earth can I use a value just for a second and then have it return back to zero?
I am really sorry, I tried to explain this as best as I could, and would be grateful for a possible solution. Thank you very much!
Answer by theANMATOR2b · Mar 05, 2017 at 09:13 PM
Not an answer -
Alternative - if the character leans every time he moves in that direction - add the lean into the animation itself.
Yes I'm aware of that, but the lean i intend to make is only a start animation (walk start, run start), lasting for several seconds, and it's additive as well.