I’m trying to make a moving background in the main menu. The animation plays itself, but when I start the game, the background stays still, and in the animator the playback is stuck at the beginning. The image is attached to the canvas, like the animator himself, the animation is looped. The code doesn’t do anything with it, I can’t find anything on the Internet about it.
here’s what I tried:
- restarting unity and re-creating the animation and animator
- the image with the animator was attached to a separate object
- without/with idle state
- run via script
- using Legacy
other animations in the project work!!
What could be wrong? Or maybe there is another way?
The process you’re looking for is called “debugging.”
By debugging you can find out exactly what your program is doing so you can fix it.
Use the above techniques to get the information you need in order to reason about what the problem is.
You can also use Debug.Log() to find out if any of your code is even running. Don’t assume it is.
Once you understand what the problem is, you may begin to reason about a solution to the problem.
You should probably debug the Animator itself first (by manipulating the properties in a blank scene at runtime) and then the code that drives those properties. If there’s a bug in your Animator, no amount of code can fix it.
For more details, look up any Unity3d Mecanim setup tutorial.
1 Like
Do you have anything that has set the timescale to 0?
Does the Background state in the Animator have its Speed set to 0?