Collision filtering

First, there are three levels of collision. Blocking, overlapping, and ignoring. For any given collision between two things, the least blocking level will be chosen. So, If you have a brick wall that blocks characters, but your character says it overlaps brick walls, then your character will be able to go through brick walls.

Then we can also decide which things we check collision against. There are two ways to do this: trace channels, and object channels. The difference is whether the thing checking collision or the things it’s colliding with define the collision level. In trace channels, each object defines how it responds to collisions in that channel. In Object channels, the thing checking defines how it deals with every other object. So, take the example of a visibility check with a window. With trace channels, I go on the glass and set it to overlap with visibility checks. With object channels, I go to the thing that’s checking and tell it to overlap with glass.

So the advantage of a trace channel is that it makes it easy to add things. Say I have a bajillion different types of collider, and I want to add a new one. With a trace channel, I just make it and tell it how to react. With object channels, I have to maintain a big list of every single object type and tell it how to deal with every one of them.

Privacy & Terms