I am unable to trigger collision to print message in the console

Hi,

I have rigidbody and box collider setup on my ship, I have terrain and enemy ship setup with collider, I followed the script for both OncollisionEnter and OntriggerEnter. But nothing is printed. Somehow doesn’t matter if I check trigger box or not on my ship, I don’t collide with the terrain or enemy ship. I even created a cube with collider on it, still nothing. I am very puzzled… Could someone please help me.

Thank you

Could you get a screenshot of the script in question, as well as the colliders of each object in the inspector?

1 Like

1 Like

Try capitalizing the ‘T’ in OnTriggerEnter(). Method names are case-sensitive. Do it with OnCollisionEnter as well.

2 Likes

Thank you, Gerald!!! I can’t believe I missed it… thank you so much!!!

1 Like

Syntax errors are the best, as they’re easy to fix. Glad I could help!

3 Likes

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

Privacy & Terms