Sorry my bad, my player and my enemy are not “Istrigger”
Well the problem is that when I click on “Is trigger” for my player and my enemy they fall even if there is a box collider above them (nothing collide).
When they are not “Is trigger” :
When they are “IsTrigger” :
If you just want it to collide with, then you would make sure the collider is turned on. So for the floor blocks underneath the character, just make sure the collider components are activated. For the enemies, make sure the colliders are activated, and the Is Trigger is also activated.
To expand on the other answers here, I notice that you’re using 2D graphics and refer to it as a 2D game, but you are using the unity callers for 3D physics.
If you’re using regular Rigidbody and Box Collider components for the physics then the problem is elsewhere.
However, if you’re using Rigidbody2D and BoxCollider2D, you’ll want to use OnCollisionEnter2D(Collision2D whatHitMe);