- Home /
Playing through sprite sheet only once?
So, I have a character (2d image on a quad) with a sprite sheet that runs infinitely, in idle position. Now, When I collect a star, I want the character to be 'happy' so what I did was change the texture of the character by using
if (condition)
{
monster.renderer.material.mainTexture = happy;
}
The Texture named "happy" is also a spritesheet by the way.
So what happens is, the character gets into the happy spritesheet but now hes happy forever until some other event happens in the game which changes the spritesheet/texture.
I want to know a way so that the happy spritesheet will run through only once, and then revert back to the original texture.
Thanks
For my spritesheet I'm using the one found on the unity wiki for animated textures
http://wiki.unity3d.com/index.php?title=Animating_Tiled_texture#CSharp_-_AnimateTiledTexture
Your answer
![](https://koobas.hobune.stream/wayback/20220613115822im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Is it possible to animate a sprite on a 3d mesh? 0 Answers
Why are my sprites being distorted? 1 Answer
Animate Image UI with Sprite Sheet 4 Answers
Using sprites in spritesheet 0 Answers
SetTextureOffset Shader code 1 Answer