2
votes

I'm working on a menu scene where the options come down from top, so I tried to use Unity simple Animator. The problem is the animation won't work. The weird part is, when I tried the same thing on my game scene the animation works.

-I've checked that the animation is attached to the object -Culling type is Always Animate -I've also added a script and tried to force the animation with no results.

Why doesn't the animation not working anything other than the main scene? Do I need to trigger something for it to work?

1
Hard to know without looking at your scene setup. Keep in mind that animation clips map to specific properties in an object hierarchy. If you're trying to attach the Animator controller to an object with different children, it won't work. My recommendation is to create the menu as a prefab, and then add it to each scene. This way the animations always reference the same hierarchy.D. A. Terre
Are you sure you are using an Animator and not Animation component in the scene where it works? You likely want an Animation component in your new menu scene.SteakOverflow

1 Answers

0
votes

Things you could check:

  1. Make sure you are using the same kind of component in both scenes. Animator is different from Animation.
  2. If you have an Animator component make sure you have an the right Animation Controller attached to it.
  3. If you have an Animation component make sure that the Animation field is set and holds your animation file and Animations is set too and holds the list of possible animations of your (UI) object.
  4. Even though they have the same extension, .anim files created when an Animation component is attached are different from .anim files created when an Animator component is attached so if you try to play an Animator .anim it won't play with an Animation component.
  5. Is your Animation set to play automatically? If not, are you giving the animation.Play() command somewhere in your code?