Well, it might be hard to understand, but what I want it to do it whenever I collide with a cube, it will destroy another game object. For example, I’m trying to make a script where when I walk through someone, like a door, an object (not the door) will be destroyed. Can anyone help?
Ok here is a REALLY simple example in JS. I tested this out by attaching the script to a sphere that moves toward me. I have a cube somewhere off to the side where I can see it. I have a box collider on my main camera. When the sphere hits the camera, the cube is destroyed, and not the sphere. This will give you a slot in the inspector to drag and drop the object you want to be destroyed (Object To Destroy). If you’re using any CharacterController Components, look into OnControllerColliderHit
#pragma strict
var objectToDestroy : GameObject;
function OnCollisionEnter(other : Collision)
{
if(other.collider.gameObject.tag == "Player")
Destroy(objectToDestroy);
}