Search In
• More options...
Find results that contain...
Find results in...
• 0

# On item collision and different ports

## Question

I am in the process of making a map right now which involves a small lift with a key on top of it. Ideally, lift's window should be too narrow and too low for player to use but enough to let player call it down and grab a the key.

It seems different source ports have different ideas whenever key should fall down or not, and I'd really like not to needless limit players just for one gimmick's sake. Can anyone provide reliable information on:

How much lift must extend from the key for it to reliably go down?

How short must a distance be for player to grab it from the ledge, without need to run into wall at full speed?

## Recommended Posts

• 0

Both questions have the same answer, basically. A key's collision box is a square of 40 map units per side (with the origin point of the key in the center, 20 units away from the sides), and 16 map units high (with the origin point at the bottom).

To pick up an object, the player's collision box must overlap with the object's collision box (including vertically). Grabs are possible because the check for overlap is done in the movement function before the checks for collision with geometry are done, so the player is allowed to be in an impossible place and collide with theoretically unreachable objects before being shunted back to playable space.

So for the player to get the key without a grab, the key must "stick out" a little bit out of the lift on the open side. Here's an example:

Red: geometry the player can't go to. Green: geometry the player can go to. Blue: lift geometry. As you can see it's a 40x48 sector. Yellow: key collision box. It's been placed on the lift centered vertically, but a bit off the side so part of it stick out in the void in the player area.

• 0

And the height will get determined by its center in this context?

• 0

An actor's height is uniform, it's the same on all points.