I am newbie in Unity & here I am trying to fire OncollisionEnter2D
I have Is Kinematic
turned Off, for the object & its calling beeCollision.js
script
If i play in Unity-editor, i can see- its colliding & forcing the Collided-object to rotate /move. So its definitely colliding, but somehow the OncollisionEnter2D
is not getting called.
However, if I put Is Trigger
on, the OnTriggerEnter2D
works just fine.
Here is the beeCollision.js script-
function OncollisionEnter2D (other: Collision2D) {
// NOT GETTING CALLED
Debug.Log("collided 1");
}
function OnTriggerEnter2D(other : Collider2D) {
// Works well, if Is Trigger is turned on
Debug.Log("collided 2");
}
& here are 2 screenshots of Unity editor-
- Settings for the Player:
- Settings for the Obstacles prefabs: