video texture play on ...

I need some help. I want to create a box with a video texture that when i’m near from it i’ll press on “e” and the texture start play.

Anyone can write a code for it, please?

I’ll appreciate so much…

Anyone can help me please?

Add the movie texture to a material and then use that material on your object. Then, you can use code like the following in your script:-

if (Input.GetKeyDown("e")) {
   var mov: MovieTexture = renderer.material.mainTexture;
   mov.Play();
}

I don’t understand… If i use this code…

if (Input.GetKeyDown("e")) {
   var mov: MovieTexture = renderer.material.mainTexture;
   mov.Play();
}

nothing happens…

Should i attach the script on my character or on the object?

And the movie texture are applied to a normal material or its a different material?

Anyone can help me please?

You need to put that code on the object with the movie texture material. This is just a normal material - there is no special type you need to use with movie textures.