Hello
i need to move an image from point A to point B. i wanted to make it smooth, so im using animations (so i can move in another directions later on if needed or in no-straight-lines manners).
the problem is: i play the animation and it starts and ends almost instantly, moving only 10% of what it should.
Animator animm = PlayerCharIMG.GetComponentInChildren<Animator>();
Debug.Log("TEST1");
animm.Play("Arcade1");
This si the code, it is in a public function that i trigger with a button.
The animation was created in unity, with the animation tool. If i check the animation tool and put play, it works perfetly, but it doesn’t in-game. I attached the animation controller to the image itself. (the gameobject that should be moving). And the animation is obviously put in the animator.
Any ideas how to fix this?
Are there any outgoing transitions in the animator? May be some condition activates a transition and animation finishes? Also in Unity the animator controller visualises it’s state in realtime during playmode. Try to dd Debug.Break in your function, start the game, wait till it pauses on debug.break, bring up the animator and analyze step by step what’s going on with your animation. It will highlight currently playing state and/or transition.
This is what i get, the animation starts, but it instantly stops. this seems to be happening with the base animation. (ArcadeTowerAnim), however that one doenst move, its just a static place to use as a basis so i cant reallly tell.
Maybe another script stopping the animator? Test it with new empty project
yeah, that was the solution, i dont know why but the timescale is set to 0 on the start, so i have to manually turn to 1 on every different scene, im still trying to figure out why it is happening.
thanks for the help!
You can search "Time.timeScale through all your solution files to find out who’s messed up with time.
Hi,iam working in unity2d and i have succesfully completed implementing runner game using keys.now iam working on joystick feature so i have used UI buttons to simulate the arrow keys functionality the character moves but it isn’t animating what shall i do?
There’s a dedicated 2D forum. Please don’t hijack/necro old threads to discuss it. Just post on the 2D forum with your issue where someone should help you.