- Home /
Question by
Whelandrew · Dec 22, 2011 at 10:08 PM ·
spritepositionruntimefreezeposition
GameObject Changes Z Position on Sprite Change
So, basically, I have 2D sprite that moves across the screen. It's Z position is set to -10 so that it overlaps other 2D objects in the scene. When the sprite is hit with a missile, it changes to an animation for the explosion. When this happens, the Z Position drops to 0.1 and falls behind most of the objects on the screen. I have attempted FreezePositionZ and have set it to reposition back to -10 when the sprite animation changes but it ignores these commands.
Any other ideas?
Comment
Answer by ahmedbenlakhdhar · Dec 13, 2014 at 05:42 PM
You need to delete the Z axis position curve in the animation of the game object.
Thanks. Gave you an upvote. Cannot mark as answers because I am not author.