- Home /
Animator disable to change in script?
Hello.
I can't to change the position of GameObject which is controlled by Animator.
In the example below, when I disable Animator, I can to change the position Sprite1. I want to change the position while controlled by the animators.
I need your help. Please tell me the solution.
Player(Script,Animator)
-Sprite1(Controll by Animator)
-Sprite2
public void test(){
Transform sprite1 = this.transform.FindChild ("Sprite1");
Transform sprite2 = this.transform.FindChild ("Sprite2");
sprite1.position = new Vector3(10.0f, 1.0f, 1.0f); //don't move
sprite2.position = new Vector3(10.0f, 1.0f, 1.0f); //move
}
Answer by PictonicStudio · Oct 17, 2015 at 08:02 PM
Disable Apply Root Motion in the Animator Component.
PictonicStudio, Thank you for your reply.
But problem did not resolve. If I disable Apply Root $$anonymous$$otion, Sprite1 don't move.
Your answer
Follow this Question
Related Questions
Why when creating new animator controller for the character the character is not walking right ? 0 Answers
How can i check if animation has finished playing if the object have no animator attached ? 1 Answer
StateMachineBehaviour Issue when swapping runtimeAnimatorController 0 Answers
Help with animator controllers 1 Answer
why I have to anim.getComponent in update() function when I had done in Start () function 2 Answers