i want made a trigger with 2 targets. in target 1: obj1 (column): in target 2: obj2 (unlockable key). When obj1 collide with trigger: activate obj2.
i have this in .js:
var obj1 : GameObject;
var obj2 : GameObject;
function OnTriggerEnter (obj1.Col:Collider)
{
obj2.SetActive(true);
}
PGJ1
2
You shouldn’t use “obj1.Col”, try with "function OnTriggerEnter (Col:Collider) " instead.
but i want the trigger only collide with target 1 (obj1) not with the player or other objects. how can i do this, without tags?
PGJ1
4
Well, you certainly can’t do it that way 
Something like this should work:
var obj1 : GameObject;
var obj2 : GameObject;
function OnTriggerEnter (Col:Collider)
{
if(Col.gameObject == obj1) {
obj2.SetActive(true);
}
}
yujuu
a lot of thanks, you save my life