Animator disabled not allow set position of the gameobject.
Hi everyone,
I have a doubt about Animator enabling and disabling behaviour. Due to a problem that one of my team mates has have in the project that he is developing, I have been doing some test with the Animator. This test has consisted in the replication of my mate's problem. The problem is that the Animator has two states. The first one has associated an animation which is a loop animation with only one keyframe for gameobject position and rotation, called Static. The second one has associated an animation in which, at the last keyframe, it calls an animation event which call a method in an associated script. The method disables the Animator and sets the gameobject position, in this specific order. And here is where the problem appears, or I think so. When the first Animator state transitions to the second one after set a trigger, the second state plays the animation associated and this calls the method previously explained. Using the Visual Studio debbuger, I was able to see that the method is called correctly. However, the Animator, despite being disabled, transitions to the first state and sets the gameobject position again to the animation position.
My first thought is that, in spite of being the Animator disabled, the animation associated with the first state, being this a loop animation, is still being animated.
Could anyone tell me if I am wrong or explain me the Animator in detail? I worked with the Animator multiple times but this is the first time that I find this problem.
Thanks for your atention.
Your answer
Follow this Question
Related Questions
Animation transition problem 1 Answer
After jump animation problem 0 Answers
Disable gameObject in animation 0 Answers
Cant override animations with scripts? 1 Answer
Simple animator/animation problem 0 Answers