I’m not sure what I’m doing wrong here. Theres a prefab of a wall. it spawn randomly and falls down. The player has to dodge it. Heres the code:
function OnCollisionEnter(col : Collision) {
print("collision");
}
(Attached to the player)
I’ve tried many combinations of each having box collider and rigid body components. Nothing seems to work. Which objects need which components or is there something wrong with the code? I’ve also tried doing OnTriggerCollision with no results either.