Why is my collisions not working

so i did everything like Rick did. my enemy placeholder has a rigidbody, my ship has a box collider and rigidbody, and is trigger and is kinematic is turned on. also my collisonhandler script is attached to my ship

Heres my code

void OnCollisionEnter(Collision other)
{

    Debug.Log("collided");

}

void onTriggerEnter(Collider other)

{

    Debug.Log("triggered");

}

but it only prints to the console when i collided with the enemy placeholder. Help?

1 Like

Welcome to the community!

You did OnTriggerEnter with a lowercase o, when it needs to be uppercase, here is the updated code:

void OnCollisionEnter(Collision other)
{
    Debug.Log("Collided");
}

void OnTriggerEnter(Collider other)
{
    Debug.Log("Triggered");
}
2 Likes

Thanks! it worked

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms