30
2018
Sprite Sheet Flip Book Shader
Converted this old animated sprite sheet script into shader,
its useful for animating sprites from sprite sheet. (when Animator is too heavy for simple sprite animation)
Could be extended to have billboard option.
Shader source: *Updated: 30/11/18 to fix index wrapping and UV direction
https://github.com/UnityCommunity/UnityLibrary/blob/master/Assets/Shaders/2D/Sprites/FlipBook.shader
Note:
– Texture should have wrap mode: Repeat *Now works with both wrapping modes (and index 0,0 start from top now)
Resources:
– Used this sprite sheet for the explosion https://opengameart.org/content/explosion-sprite
Some debugging drawings in excel..
Related Posts
2 Comments + Add Comment
Leave a comment
Recent posts
- MotionVector Effect: Object “disappears” when paused
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
Recent Comments
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on
Thanks for sharing this. As it is, it’ll nicely work for things that repeat constantly. Do you know how you’d go about making it a one-shot animation? You’d need some way of triggering it to start on the correct frame and stop rendering once it hit the last frame.
Thanks you !