- Home /
Animator controller stops canvas sprite code movement
Hi, I posted first forum question yesterday same issue, but I got some way through, so re-phrasing question. i'm a Unity beginner. https://answers.unity.com/questions/1495301/canvas-movement-code-being-disabled.html I have code script to enable player to move canvas background sprite (appears like player is moving while player sprite stays same position on screen). This worked fine until I started adjusting a Timeline animation, which moves this same canvas sprite.
At present, if I remove the Animation controller from the Animator component of the Canvas object, then the code movement works. If I put it back in, the code does not work, and when game plays and I press W or D to move up or right, in the Inspector I can see the Pos X and Pos Y attributes of the canvas background change briefly, then get pulled back to their original values (ie it just looks like player sprite shaking on screen).
So I guess this is something to do with me messing up my Animator controller. In the Timeline, I have two animation clips, one for the player sprite, and one for this canvas background sprite. Actually I got it to work briefly playing timeline beginning of Scene, and this code movement still worked when Timeline finished. But then I think it was after I chose "Edit in Animation Window" and made changes there, may have been when it broke the code movement. Separately, just in case related, the player sprite animation in same Timeline was changing scale correctly on runtime, but position and rotation changes in animation clip would not appear at runtime - this might be unrelated issue though. Tx kindly any suggestions.
Your answer

Follow this Question
Related Questions
Problems with walking animation 0 Answers
Game Object not moving in Canvas 0 Answers
When timeline cutscene is over, I can't move my character. 1 Answer
Animator Start and Stop Animations 0 Answers