[Solved] OnCollision not working and wont log to console

Ive used OnCollisionEnter 2D so that when my ball hits the box at the bottom of the screen it logs to the console that they have collided, but for some reason it doesnt want to work. ive used OnTriggerEnter2D for when the box is set to is trigger which works fine.

Hi Oliver,

You have incorrectly spelt the name of the method.

You have OnCollisonEnter2D where as you need OnCollisionEnter2D.

Hope this helps.

Ah yes.
what a stupid mistake., Thanks Rob! :slightly_smiling_face:

1 Like

Don’t beat yourself up, we all make them - they often add another tool to the toolbelt also, as next time you encounter an issue, you may check for the spelling or case-sensitivity of method names etc first :slight_smile:

Privacy & Terms