Question by
Hat333 · Dec 01, 2021 at 04:02 AM ·
movementrigidbodybeginnerboxcollider
2D Rigidbody Object Moving Partially Into Barriers
Beginner here.
I have a Rigidbody Object set up with a Box Collider. It has a simple movement script that allows the object to move up/down/left/right at a constant speed.
However, whenever the object hits a barrier (as in another Box Collider) it moves inside the barrier a few pixels before being pushed out after the directional key (such as an arrow key) is let go.
Is there any way I can fix this so the object simply stops before going inside the Box Collider?
Comment