IT lexicon › Programming › Collide and slide

Collide and slide

Programming På svenska → Updated: 2026-10-25

A movement algorithm that, on collision, projects the remaining motion along the surface so the character slides along the wall instead of stopping dead.

Without it, a player who walks at an angle into a wall simply halts; with it, they keep moving along the wall using the component of their velocity that points along the surface. The trick is to project the movement vector onto the surface plane, re-test against the next surface, and iterate a few passes per frame — otherwise the character squeezes through corners.

The method was popularized by Kasper Fauerby's 2003 paper Improved Collision Detection and Response, which slid an ellipsoid through the world. Modern engines usually use a capsule and a shapecast, but the core loop — collide, project, slide, repeat — is unchanged.

← Back to the lexicon