- Home /
sprite after animation
Hello,
My game`s hero is supposed to have several animations and 1 state as idle. The problem is that after any animation played, the heroe`s image goes back to default, but I need it to be the last frame of animation. I tried to set it in runtime like
public Sprite RightBottomImage;
...
spriteRenderer.sprite = RightBottomImage;
But it gave to result. Any thoughts?
Answer by RandomDSplayer · Jan 03, 2014 at 12:06 AM
An idea is that the animation needs work. I'm not criticizing, but animations usually work unless there is a glitch in the animation. Possibly trying to slightly change the code or looking for syntax errors will help you fix the animation.
The point is that the animation plays well and there is no code do manipulate with it. The animation was made with the native means of Unity (set of frames) and nothing else (but triggers on the last frame, where the log message is displayed). And after the last frame is played, the object`s image is back to default. The code above was my try to fix this with no success
Your answer
Follow this Question
Related Questions
How can I get my BoxCollider2D to stay centered on my sprite? 2 Answers
How many pixels/inches is one meter 1 Answer
What is the best way to pixelate 2D sprites 0 Answers
Unity2D resize the sprite 0 Answers