I’m beginning a series of “Behind the Scenes” posts which will explain various bits of technology and design concepts involved in making video games.
Today, I’m going to discuss a concept I call Coinciding Collision Meshes.
What this means, is that you have multiple variations on structures with which physics-enabled objects can collide. In other words, if a box is thrown against a collision mesh designed to react to boxes, it will bounce off of it. However, if that same box is thrown against a collision mesh designed for potatoes or rubber balls, it will go straight through the mesh structure.


To illustrate the idea of collision meshes, here are some pictures of a single collision mesh in use. Notice how the “mesh” is actually made of differently sized boxes. This is the most common method used to quickly block off certain areas of a level – in this case I was blocking off the pits around the side of the room to keep the player from falling over the edge.
Once the boxes have all be placed, they are then made invisible to the player. So when you play the game, all you see is a pit. If you try to walk into it, you hit an invisible wall.
If this game was a first person shooter, and you wanted to be able to shoot down or over the pit, you could simply put all your projectiles in to a “Projectile” layer and tell the collision mesh to ignore them.
Now, to explain Coinciding Collision Meshes!
As I said above, this is when you have multiple variations on a structure with each variation being designed to collide with a different physics object. One of the most common uses for this in games is stairs.
As I’m sure you’re aware, stairs are comprised of steps. In game engines, players typically have an attribute called “step height” or some variation on that. The step height is the maximum height that a player can step up a ledge; so if the height was above the player’s head, it would imply that they could somehow raise their feet above their head and push themselves up to the next ledge. Since that would be pretty weird, the step height is usually set to something more akin to a twice the height of a normal household stairway step; since our hero is cool enough to take stairs two steps at a time.
What you may notice however, is that both in real life and in games, if you take a step up it will slow down your forward motion while you’re exerting effort raising your body to the next height level. In most game engines, this happens a lot less smoothly than in real life – it’s almost like if you were to instantly raise your body to the next height level the moment you put your foot on the next step. Since that looks pretty weird, especially in a game perspective, it has become relatively standard practice to turn stairs into ramps.
When a player walks up a sloped ramp, their elevating motion is every bit as smooth an ascent as the ramp itself. However, what if we still want it to look like stairs, even though we walk up them smoothly?
For this, we use a simplified collision mesh, which, like the boxes in the images above, will be invisible to the player, but will still restrict the player’s movement. So the environment artists can still throw in stairs to their hearts’ content, but the player will only see them visually, while their in-game body reacts to the invisible ramp aligned with the stairs. This creates a smooth motion as the player climbs up what looks like stairs, but acts like a ramp.
That however, is still just a single collision mesh – what if we want the player to walk up the stairs smoothly, but we still wanted their feet to react as though they were walking up steps? For this, we use coinciding collision meshes.
The initial setup for this, is to have a general player collision object, usually a capsule shape that covers the whole player, with the bottom just a little above the feet. This capsule moves with the player and collides with the ramp collision mesh as discussed above. In addition to that, they also have collision objects on their feet, which are set not collide with the ramp collision mesh, but rather with the individual step collision meshes.
The setup for the collision meshes is illustrated in the screenshots below:



