- Home /
Playing a Video Trailer introduction for a Game
Can someone explain in detail how to make a video file to play in the begining of the game and after it finishes playing it will load the next level which is probably the Main Menu?
Answer by jashan · Jul 27, 2010 at 09:49 AM
This forum posting should help you get started: video intro
From the documentation: MovieTexture
Another forum posting that should help: Loading Level After Video Played
If you're using Application.CanStreamedLevelBeLoaded you need to be careful to have the scene you're checking (your main scene) also available in the build settings (otherwise this will always fail).
The solution with checking if the video is still playing should work fine ;-)
So, to sum it up (and add some detail):
- In your "trailer scene"; have a game object with a script attached that starts playing the video in the Start() method
- After the video has started, check whether it is still playing - when it's no longer playing, use Application.LoadLevel to load your main menu
- Display the video using UnityGUI (as in the above mentioned forum posting)
That should be it ;-)
Other relevant postings that might be helpful: Playing videos in the GUI, How do I play a full screen video? ... for any iPhone users that run into this question - on Unity iPhone, things work a little differently: how integrate video before menu in unity iphone game
Answer by psykojello2 · Nov 13, 2015 at 12:10 PM
I know this was asked in 2010, but for anyone searching in 2015, you can use : Handheld.PlayFullScreenMovie() to play a video file on mobile.
@psykojello2 please help me in play an alpha channel video. i am just beginner and played a normal video on target.
Unfortunately I know nothing about playing an alpha channel video. It would be better to ask a question directly on the answers forum. Good luck!
P.S. I'm not sure if you can play alpha video on mobile, but I could be wrong.
sadly that doesn't work for me anymore... http://answers.unity3d.com/questions/1368774/handheldplayfullscreenmovie-wont-work.html