
my player object is passing through box collider. why collision is not working properly.
need help ASAP!
Code file → Player Movement.txt - Google Drive
Code file → Player Movement.txt - Google Drive
Without the code its difficult to diagnose what’s causing the issue but I can add a few points until the code is uploaded.
Have you checked the box collider bounds?
Is it that the force that you are apply is too great meaning you’re pushing the object through the wall?
Try to reduce the force applied.
Is your object “mass” set too high?
Can you try reducing it below 5 and see if the issue remains.
Are you using the rigidBody commands to move or transforming the position?
You should not be using transform commands with a rigidBody but rather the rigidBody transforms;
i.e - .MovePosition()
and .MoveRotation()
.
Are you using Update
or FixedUpdate
?
You should be using FixedUpdate
when working with RigidBodies.
Hope that helps!
You probably want to set the collision detection to continuous.