I’ve created an arrow and a wall, both having BoxColliders
. Only the arrow has a Rigidbody
, attached and neither collider is marked as isTrigger
. The arrow’s script includes an onCollisionEnter
function:
void onCollisionEnter(Collision other){
Debug.log("Collided");
if(other.gameObject.tag != "animal"){
Destroy (gameObject);
}
}
The OnCollisionEnter function, however, is never called. What am I doing wrong? The arrow stops moving after it hits the cube, and turning on isKinematic
makes it pass through.