0
\$\begingroup\$

Screenshot of Game Scene

The Wall moves to the right and pushes the Character with it. The character travels along a bunch of Blocks with colliders attached to them.

This is the result:

Animated gif showing wall passing through character

At some point, the Character gets stuck and the Wall goes through the Character and comes out the other side.

I've tried to play around with the collision detection and other values of the rigidbodies. I tried to add a Physics material with no friction.

I am wondering what could cause this issue.

Here are the values of my GameObjects

Settings used on game objects

\$\endgroup\$
  • 2
    \$\begingroup\$ It looks like you're running into a common physics engine artifact that arises when you try to push a box along a floor made of other boxes. The next tile pushes back on the cube just as hard as the wall pushes forward, resulting in the cube sticking in place. Since the wall is kinematic, it's allowed to push through colliders in its way, so it penetrates into the cube when this happens, and the cube gets restituted out the other side. \$\endgroup\$ – DMGregory Jan 20 at 17:23
  • 1
    \$\begingroup\$ In this particular case, switching to 2d physics with 3d graphics might also help. Especially since a 2d collider can have rounded edges. \$\endgroup\$ – Louis Garczynski Jan 21 at 18:09
  • \$\begingroup\$ @DMGregory@LouisGarczynski Thanks for your infos again guys, using 2D sounds well too, but I already created my custom "physics engine", using transforms and updates for movement, colliders for collision check, but o rigidbodies. \$\endgroup\$ – Frank Cranston Jan 22 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.