Activating movie with external trigger

A new day, a new noobie issue:

At this point I’m trying to trigger a movie texture with a collider… The collider however is another gameobject on the other side of the room. How should I combine those 2? I’ve tried attaching them to each other but that doesn’t seem to work at all.

I think about referring in my moviescript to the collider but how does it work.

Final question, when I get this to work, I really want to attach different movie texture to one object and attach those to different colliders i.e. when I enter an area in the room i want to play a different movie then when I’m on the other side of that same room. Is this possible?

Thanks in advance

hello!

definitely possible

first of all, when using triggers there is an option named other : Collider on the trigger function you can access the object that collided just by asking the collider it’s gameObject, like this:

other.gameObject

and you can change the movies, just by changing the reference of your movie on the texture, check the documentation :smile:

hope it helps! :wink:

thanks for helping me again :smile:

Sigh… still not getting it…

I’ve this piece of code attached to the screen that I want the movie to play on

var gameObject : GameObject;

function OnTriggerEnter(otherObject : Collider) {
 
 renderer.material.mainTexture.Play();


}

However nothing happens… did I already say that I’m a noob :frowning:

help me pls

thanks

Hello!

ok, first of all, have you checked that your collider is getting triggered?

you could use Debug.Log(“IT COLLIDED”); for example, to know if the trigger is being activated.

Checkout this post about colliders/rigid bodies as maybe your trigger is not being activated :).

http://col000r.blogspot.com/2009/06/unity-triggers-and-colliders.html

Hope it helps ! :wink: