So I have 2 prefabs, 1 with a 2d box collider, and one with a 2d box collider and a 2d Rigidbody:
I instantiated both of them, the robot prefab in a robot script and the grass prefab in the board manager script. I want to check if the robot is colliding with the grass in the code, so I add this in the robot script:
void OnCollisionEnter2D(Collision2D coll) {
Debug.Log ("Detected!");
}
When I run, the robot falls onto the grass, and the console remains silent. Did I do something wrong?