How can play a movie from a button?

Hi!

I’m making a augmented reality project in Unity and I have a game object that displays on the center. (There are other objects with animations on the screen but they are only used as fillers for the scene)

What I want is when I click this object a movie (mp4) will start playing at full screen and when the movie finish it will go back to the scene.

I’m using C# but I’m as you may call a N00B, so if you can guide me step by step to make this possible I would be delighted!

Thanks in advance

This will depend on the platform you target and your GUI system.
Here are some really useful documentation if you want to play a video.
Here is the Movie Texture system and the MovieTexture class. It doesn’t work on all platforms.

On mobile, you’ll need to use the Handheld class.
You can also look at the Unity Assetstore and see if you find something interesting.

To resume.

  • Choose you target platform.
  • Choose your GUI system (built-in, NGUI, etc…).
  • Look at the associated documentation they have great and easy examples.

I just wanted to tell you that I solved the problem, I used arrays to maik it work, but at least in my android worls perfectly. Here is the code I used (Is in JS)

#pragma strict
// Use mousedown function in arrays like this

function OnMouseDown()
{
var pizzaArray = GameObject.FindGameObjectsWithTag (“pizza”);

for(var i = 0; i < pizzaArray.length; ++i)
{
Handheld.PlayFullScreenMovie (“movie.mp4”, Color.black, FullScreenMovieControlMode.Full);
}

}