Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/entities/guides/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "title": "Guides" }
36 changes: 36 additions & 0 deletions docs/entities/guides/portal-floor-button-triggers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Portal Floor Button Triggers
weight: 5
features:
- MOD_PORTAL2
---

# Portal Floor Button Triggers

The entities [`prop_floor_button`](../reference/prop_floor_button), [`prop_floor_cube_button`](../reference/prop_floor_button), [`prop_floor_ball_button`](../reference/prop_floor_ball_button) and [`prop_under_floor_button`](../reference/prop_under_floor_button) spawn a trigger volume to detect players and cubes.
Each entity uses a different bounding size to match the default model, but custom models may need their own size.
To allow this, these entities look for a hitbox group named `trigger`, and match the size of this. For example, this is the equivalent QC section for a standard modern button:

```php
$hboxset "default"
$hbox 0 "portal_button_root" -62.46 -7.36 -62.46 62.46 13.64 62.46
$hbox 0 "portal_button_top" -31.81 -4.91 -31.81 31.80 0.00 31.77

$hboxset "trigger"
$hbox 0 "portal_button_root" -20 -20 0 20 20 14
```

The first hitbox set here is used for bullet collisions and other normal purposes. This is normally autogenerated. To get the first set, open your model in HLMV, uncheck "Autogenerate Hitboxes" on the lower-left of the "Bones" tab, then press "Generate QC" in the upper-right. You can also create/edit the trigger hitboxes here, especially handy for fine-tuning positioning.

The trigger is always created with the same orientation as the button entity, so
the specific bone does not matter.

## Default sizes
For reference, the default sizes are as follows. All are square, and start at z=0:

| Classname | Half-Size | Height |
| ------------------------- | -- | ---|
| `prop_floor_button` | 20 | 14 |
| `prop_floor_cube_button` | 20 | 14 |
| `prop_floor_ball_button` | 5 | 14 |
| `prop_under_floor_button` | 30 | 17 |
2 changes: 1 addition & 1 deletion docs/entities/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "title": "Entities" }
{ "title": "Entities", "weight": 100 }