Hitboxes
Since version 2.6, every vehicle has a hitbox that matches its shape:- Click anywhere on a vehicle to enter it.
- Click near a passenger seat to sit in that seat.
- Hit the vehicle anywhere to damage it, if
enable_VehicleDamageis on. - Players riding a vehicle no longer collide with it.
hitboxes section of the main config.
Generated hitboxes
If a vehicle file has nohitbox option, the plugin generates one from:
- the driver and passenger seats, with some space around them and room above for the riders
- the vehicle length, from
center,front_vector_offsetandback_vector_offset - the legacy
widthOffsetandheightOffsetoptions
hitbox option.
The hitbox option
Thehitbox option is one box, or a list of boxes for vehicles with a more complex shape.
The positions are relative to the vehicle model: +X points to the front of the vehicle, +Y is up and +Z is to the side.
length, width and height must be greater than 0, or the box is skipped and a warning is shown in the console.
One box
Several boxes
For example, a truck with a tall cab and a lower bed:Seeing the hitboxes
Use/qav hitbox to show the hitboxes and seats of nearby vehicles with particles. Run it again to hide them.
If you are looking at a vehicle when you run the command, the chat shows:
- the boxes of that vehicle, and whether they were generated
- the point you are looking at, in the vehicle’s local coordinates
- the seat that a click on that point would select
x, y and z of your boxes.
The command needs the
qualityarmoryvehicles.debug permission.