Search code examples
unity-game-engineunity3d-2dtoolsunity3d-gui

Animation not working in game as it is in the scene view


I'm trying to make an animation where the word contained in the middle of the screen has its letters that get highlighted one by one using an image overlay on which I increase the alpha from 0 to 0.5 over a short period.

My problem is, even though the animation is fine in the scene view and when previewed, the overlay image seems to be duplicated out of nowhere and always in the same place.

Those duplicates do not appear in the scene view but they do appear in the game view and I can see no reason for them to show up.

Here are screenshots from the scene and game view :

Game view with the unwanted images being the two big letter backgrounds

Scene view where they do not appear

EDIT : After more tests it is definitely an animation problem. The animation runs as it should in the scene view but on some letters, in the game view, it is misplaced and scaled differently.

Here are some more screenshots of what is going on :

Scene view Scene view Game view Game view


Solution

  • Ok so this was kind of silly mistake. It was caused by a z value on my animated object set to -1595. Setting it to 0 did the trick and the animation is now playing normally.