Unity Player Sticking to Walls Issue: Causes and Reliable Fixes

Unity Tilting Character on Z Axis Bug: Why Your Player Starts Leaning or Falling Sideways
February 21, 2026
Unity Rigidbody vs CharacterController
Unity Rigidbody vs CharacterController: Complete Comparison and When to Use Each
February 21, 2026
Unity Tilting Character on Z Axis Bug: Why Your Player Starts Leaning or Falling Sideways
February 21, 2026
Unity Rigidbody vs CharacterController
Unity Rigidbody vs CharacterController: Complete Comparison and When to Use Each
February 21, 2026

Unity Player Sticking to Walls Issue: Causes and Reliable Fixes

Your character moves fine in open space. But the moment it touches a wall, something feels wrong.

The player slows down. Movement feels sticky. Sometimes the character completely stops when pressing forward against a wall. Other times it slides awkwardly or jitters.

This is the classic “player sticking to walls” issue in Unity.

The good news is that this is not a mysterious engine bug. It usually comes from collider setup, physics friction, or how movement direction is calculated.

How the Problem Usually Appears

  • Character stops when pressing diagonally into a wall
  • Movement feels heavy near obstacles
  • Player cannot slide smoothly along walls
  • Character vibrates when colliding

The root cause depends on whether you are using Rigidbody or CharacterController.

Case 1: Rigidbody Player Sticking to Walls

Cause 1: High Friction on Colliders

Unity physics materials control friction between surfaces. If both the player and wall have friction, they will “grab” each other.

Fix: Create a Low-Friction Physics Material

Create a new Physics Material and set:

  • Dynamic Friction = 0
  • Static Friction = 0
  • Friction Combine = Minimum

Assign it to the player collider.

This allows smooth sliding along walls.

Cause 2: Movement Using AddForce

If you use AddForce for movement, collisions can counteract that force and cause sticking.

Example risky movement:

rb.AddForce(moveDirection * speed);

This approach can produce inconsistent results near walls.

Fix: Set Velocity Directly

Vector3 velocity = moveDirection * speed;
velocity.y = rb.velocity.y;
rb.velocity = velocity;

Direct velocity control prevents unwanted slowdown caused by collision resistance.

Case 2: CharacterController Sticking to Walls

CharacterController works differently from Rigidbody. It does not use physics forces. Instead, it moves using collision detection.

Cause: Movement Direction Includes Wall Normal

If your movement direction pushes directly into a wall, the controller may block movement entirely.

For example, pressing forward while slightly angled into a wall can cancel horizontal movement.

Fix: Project Movement Along the Surface

When detecting a collision, you can project movement along the wall surface.

Vector3 projectedMove = Vector3.ProjectOnPlane(moveDirection, hit.normal);
controller.Move(projectedMove * speed * Time.deltaTime);

This allows the player to slide smoothly along walls instead of getting stuck.

Cause 3: Capsule vs Box Collider

If your player uses a BoxCollider, corners may catch on walls.

CapsuleCollider is strongly recommended for characters because its rounded shape prevents edge catching.

Cause 4: Incorrect Skin Width (CharacterController)

CharacterController has a property called Skin Width.

If it is too small, the player may snag on surfaces.

Recommended Setting

  • Skin Width = 0.05 or slightly higher

This gives better collision smoothing.

Cause 5: Wall Colliders with Rough Geometry

If walls are made from many small colliders or uneven mesh colliders, the player may catch on edges.

Solutions:

  • Use simple BoxColliders for walls
  • Avoid unnecessary MeshColliders
  • Clean up level geometry

Diagonal Movement Problem

Another common issue happens when pressing two movement keys at once (W + D).

If you do not normalize the movement vector, diagonal movement can behave strangely near walls.

Fix: Normalize Movement Direction

Vector3 move = new Vector3(inputX, 0, inputZ);

if (move.magnitude > 1f)
{
    move.Normalize();
}

This ensures consistent movement speed and smoother wall interaction.

Extra Stability Tip: Freeze Rotation

If using Rigidbody, always freeze X and Z rotation to prevent tilt-based sticking.

rb.constraints = RigidbodyConstraints.FreezeRotationX 
               | RigidbodyConstraints.FreezeRotationZ;

Debug Checklist

  • Does the player have a zero-friction Physics Material?
  • Are you using velocity instead of AddForce?
  • Is your collider a CapsuleCollider?
  • Is Skin Width properly set?
  • Is movement vector normalized?

Is This a Unity Bug?

No. This behavior usually comes from physics friction or collision math. Unity is doing exactly what the physics system is designed to do.

Character-style movement requires restricting friction and carefully handling movement vectors.

Final Thoughts

Player sticking to walls is one of the most common movement issues in Unity. Fortunately, it has predictable causes.

Start by removing friction. Then check your movement logic. Finally, verify collider setup.

Once those are correct, wall movement becomes smooth and natural.

Leave a Reply

Your email address will not be published. Required fields are marked *


Skip to toolbar