Question by
JeremyGames · Sep 04, 2015 at 07:36 AM ·
tagdeletetwo
Delete object when two TAGGED objects collide
Hello, I need help. I'am making a game like portal and want to make it so that when the player drops the cube on a button it will delete a door gameobject
Comment
Answer by Fappp · Sep 04, 2015 at 07:55 AM
The button has a trigger. The cube has a tag "Cube".
function OnTriggerEnter ( other : Collider ){
if other.gameObject.CompareTag("Cube"){
GameObject.Destroy( door );
}
}
thats it basically, this is JS written out of the blue, might contain errors.