- Home /
Animator not working properly
My problem is a little complicated but I will try to explain it properly. So the thing is I have a script that can swap the character controllers of 2 characters ( let's call them player1 and player2) If you control "Player1" the script puts the player controller off from "player2" (where my scripting for my animations is). Now I get a glitch if I run while swapping characters the running animation keeps playing on the other character instead of going to idle because it just stops the script and doesn’t update my speed parameters in the animator. I know this explanation is weird but if you can help me I would be very thankful.
This script swaps character controllers:
My character controller script is big so this is just the animation scripting in an other script
Answer by Alturis2 · Aug 06, 2017 at 03:13 PM
Not sure I fully understand but if the problem is that after the swap you don't get the final "tick" needed to leave the animator in the right state can you not just manually call the update() once when the switch happens after the switch has occurred but before leaving that switch function?
Hey man just maneged to fix it by this line of code in the CharacterController thx for the replay.
if (Input.GetButtonDown("Fire1"))
{
anim.SetFloat("Speed", 0);
}
Your answer
Follow this Question
Related Questions
why I have to anim.getComponent in update() function when I had done in Start () function 2 Answers
Armature bone unable to rotate while animation playing 1 Answer
Have some minor problems. Cant tell if its a script issue or a animator issue. 1 Answer
How to stop animation from playing in c#. 7 Answers
Is there a new retargetting system for the animation in 5.5? 1 Answer