- Home /
Changing png at run time
Hello Friends i am new to unity. and my problem is that i have 8 png of a dragon and i just want to animate it ie change png in loop so that it seems that dragon is flying. How to do it ..
Answer by robertbu · Sep 29, 2013 at 05:26 PM
You can swap between the various textures:
http://answers.unity3d.com/questions/392517/introduction-movie.html
Or you can make a sprite sheet out of them and change he material offset. There are a couple of scripts in Wiki:
http://wiki.unity3d.com/index.php?title=Animating_Tiled_texture
And there are other, more efficient ways.
@robertbu thanks it doing some thing now. but which renderer to attach? either LIne or any other.. when I am using Line redere it just simply draw a line and nothing
If you are talking about the first script:
Create a Quad (Game Object>Create Other>Quad)
Create a new material (Right click in the Project pane, select Create>$$anonymous$$aterial.
Select Unlit>Texture for the shader for the material.
Drag and drop the material onto your Quad
Attach the script
You don't want a Line Renderer. A Quad comes with a $$anonymous$$esh Renderer.
@robertbu I wish I could Upvote your comments..but can't..