- Home /
Animation keeps velocity, position and animation when re enabled,Animator keeps animation and velocity when re enabled
Hi guys, I have a script which toggles between animation and ragdoll. I'm using animator.enabled to switch off the animation. I'm controlling my character and let's say that in mid-jump animation I toggle ragdoll mode. the character flops to the ground as expected, however as I re enabled the animator, it continues the jump animation from the same spot with the same velocity as before.
How can I avoid this so that I can re enable the animator without the previous state?
I should say that I'm using a blend tree for walking and running from the entry state, and from that I have a jump blend tree.
Thanks.
Answer by GregSmash · Apr 16, 2020 at 01:36 AM
I think the solution is in "Parameters", idk if you used, but when i made a character when he jumps and flops to the ground a gameobject (in the feets in player) and a parameter check if the player touch the ground. Parameters can manage animator with animator.setBool("NameParameter", Bool).
That line make the player return to the state idle.
if i commented, the player fleets. Also parameters can used in conditions (in a arrows) to return state and in code you call the animator state to change a parameter.
I hope I have helped you with something :D.
Answer by rantzvi · Apr 16, 2020 at 03:19 PM
Thanks @GregSmash, however I already tried using, parameters, even without exit time or exit duration on the animation, it still returns to Jump first...
Your answer
Follow this Question
Related Questions
Implimenting RagDoll physics with Spine Skeleton? 0 Answers
remove this post 3 Answers
How should I make a animate fully physics based Active Ragdoll? 0 Answers
Animation is not playing when using ragdoll physics 1 Answer
Mecanim and Ragdoll Issues? 2 Answers