Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Destry on TriggerEnter

$
0
0
Hi, I'm trying to make triggers for a game so that when the player enters it something happens. Instead of making whole new scripts for all the triggers in the game, I'm trying to make a single script that contains all data of all triggers in game and attach it to the player. This is my current script,

var t1 : GameObject;
var t2 : GameObject;

function OnTriggerEnter (other : Collider)
{
if(other.gameObject == "t1")
{
Destroy(other.gameObject);
}
}

I assigned this...

Destry on TriggerEnter

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>