keskiviikko 2. marraskuuta 2016

Unity platformer - Movie texture

NAV15AP

2. jakso lukuvuonna 2016-2017

This is tutorial for making animated cutscene using a movie texture in Unity.

First you’ll need animation. It can be in any file format but Unity uses .ogv so you want to convert it to that format first. Easiest way to do this is to download Theora converter.NET. With that program you can convert your file in the wanted format. Download the converter and install it: https://sourceforge.net/projects/theoraconverter/


After downloading install it by clicking the setup.msi icon. 


You can now start the converter. Choose your file that needs to be converted and select the location you want your file to end up to. Depending on the file size the conversion might take a couple of minutes.

In the meanwhile, you can download Apple Quicktime. It is required for Unity to import the video files. https://support.apple.com/kb/DL837?viewlocale=fi_FI&locale=fi_FI


Now you can import your video file to Unity. Create plane from gameobject tab. Rotate and resize the plane and move the camera so that the plane is covering the whole scene that camera sees. 


Drag and drop the movie texture to plane object. Your movie texture should now show in the plane as completely black.

Last thing you’ll need to do is to play the animation. This is done by adding FSM to the plane object.


Simply select action called play movie texture to the first state and select your animation as the texture. This will then play the animation. If you want to switch scenes after the animation is finished you’ll need to use action wait and wait correct amount of time before loading a new level.




There are few more actions for movie texture in playmaker. Stop movie texture will stop the clip and rewind it. Pause movie texture will pause it.

Ei kommentteja:

Lähetä kommentti