well i made a quick script to see if i could get these two cube to destroy each other with the same tag so tell me what you think is wrong im not seeing the problem on play when they hit the floor the disappear but i don’t want it oncollision i want it oncollision if the tag is type thing any help thanks…
using UnityEngine;
using System.Collections;
public class RedDestroyer : MonoBehaviour {
void OnCollisionEnter(Collision gameObject) {
if (transform.gameObject.tag == "red") {
Destroy(this.gameObject);
}
}
}
im attaching it to both so they get the idea to leave the world…