- Home /
How do I animate a pre-animated video on Unity Material object?
I have created a plane mesh, which has a little video 2d animation, created on 3d Studio. This animates well in rendering on this, however, importing it and placing it in the world space on Unity, does not reveal, possibly setting incorrect, anybody know the answer?
Are you using a movie texture for this? Are you seeing nothing at all or just the first frame or... ?
Answer by Jack Eaves · May 24, 2010 at 06:05 PM
[Edit] just realised your question was asked on Feb 17th and it is now May, oh well maybe you still need help.
I assume you've created the plane and have the animated texture working within 3D Studio, but then when you import it to Unity it doesn't play.
Here is what you shoud do (assuming you havn't already.
Place your Plane into the scene (or create a new Plane via Game Object > Create Other > Plane)
Click on your plane and go to 'Mesh renderer' in the Inspector Window, then go to Materials and where it says 'Element 0' press the arrow to open a dropdown menu and select your Animated Texture (or simply drag the texture into this field). This assigns the texture to the plane.
It's a good idea to change the shader of the texture to Self-Illumin/Dissuse as this means that the texture generates light and will be coreectly visable (though this is only a personal preference)
Next you will need a script to tell the animation to play and when to play it, here is an example here:
function Start () { // play the cutscene renderer.material.mainTexture.Play (); }
Assign this script to the Plane that the texture is applied to, That will simply play the animation straight away as you start playing.
Hope that helps.
Your answer
Follow this Question
Related Questions
3D Video within Scene 1 Answer
RawImage flicker when changing from Texture2D to VideoPlayer texture 1 Answer
[2D] Place video in the background 1 Answer
2D Animation does not start 1 Answer