4
\$\begingroup\$

The boxes are standing right next to each other, but somehow, the player manages to collide with the ghost edge. I use AddForce to control the player with a Box Collider, though I also tried using a Mesh Collider, and I tried setting the player's collision to continuous. This also happens in 2D.

WallOne(Transform(Position:-2, 0, -6.5; Rotation: Identity; Scale: Vector3.One); Cube(Mesh Filter); Box Collider(Is Trigger: False; Material: NoFriction; Center: Vector3.Zero; Size: Vector3.One)); WallTwo(Transform(Position:-1, 0, -6.5; Rotation: Identity; Scale: Vector3.One); Cube(Mesh Filter); Box Collider(Is Trigger: False; Material: NoFriction; Center: Vector3.Zero; Size: Vector3.One)); Boxes are placed side by side, but player collides with the shared wall, and stops moving.

I've seen other people's posts about this bug, but I couldn't really understand how to fix it. How do I fix this?

\$\endgroup\$
1
\$\begingroup\$

I think I had a similar issue in 2D. Try replacing your Box Collider with a reasonably sized sphere or capsule.

In 2D, I ended up using a Circle Collider with a smaller Box Collider. The Circle Collider made it so that my player didn't get hung up on the floor and walls that were composed of discrete boxes (with associated Box Xolliders). I added the smaller Box Collider to the player, because as a 2D platformer, I did not want my player to slide off the edge of obstacles.

\$\endgroup\$
  • \$\begingroup\$ Er. My mistake. I didn't realize this question was that old. Hopefully the answer will still be helpful for someone else. \$\endgroup\$ – derstander Dec 10 '16 at 2:15
  • \$\begingroup\$ Question age doesn't matter :) As you say, maybe it will help someone! \$\endgroup\$ – Alexandre Vaillancourt Dec 10 '16 at 2:37
0
\$\begingroup\$

Try changing the material of your box colliders. Also, I found a similar thread in Unity forums. That's about 2D, but the problem seems to be the same.

\$\endgroup\$
  • \$\begingroup\$ No it's not that, I tried everything, no static friction, no friction at all ect.. \$\endgroup\$ – Mateusz Sowiński Jan 25 '16 at 18:40

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.