Hi! i am new to Unity, so my apologies if the question is sort of naive and not worth your time, but i would really appreciate if someone could answer it.
In the online documentations of Unity i have read two OnCollisionEnter2D methods one is Monobehaviour.OnCollisionEnter2D and the other one is Collider2D.OnCollisionEnter2D, Now i know that you can use the first method if the script is inherited from Monobehaviour and the other one if you have a collider2D component on the gameobject. But why are there two of these?
And if two objects collide with each other who’s OnCollisionEnter is called, and which of the above is it?
Thank you!
-Hashim