jlaw97
1
I am making a level of my game, I must make the player not leave the environment with the walls, the wall has:
- Box Collider, trigger disabled
2.Static
The player
- Box Collider
- Rigibody Kinematic enabled.
Kinematic so that the player does not push me or make it rotate.
How do I make it work? So that the player crashes, does not go through the wall and is not pushed or altered.
kdgalla
2
For kinematic rigidbodies, use the MovePosition method.
Edy
3
The problem is that kinematic bodies don’t react to collisions, so they may be positioned anywhere, regardless of other colliders.
Rigidbodies react to collisions only if these conditions are met:
- The rigidbody is not kinematic.
- The rigidbody is moved using the AddForce methods exclusively (don’t modify the Transform, nor use MovePosition).