Trigger facing direction - EmeraldTiger/Re-Mobilize GitHub Wiki
Already in vanilla Quake it's possible to give triggers an angle property to fire the trigger's targets only if the player is (at least roughly) facing the direction specified by angle. The check is very permissive because it is considered successful if the player looks straight in the intended direction, but also up to 90° away (and all the intermediate angles too of course).
That may be too imprecise in many situations, so now you can set the homing property to define the precision/tolerance.
- 0 is default and acts like vanilla.
- 1 means the player's facing direction must absolutely be exactly the same as the trigger. It is not advised to use this value because the slightest variation can make the check unsuccessful; and variations do happen! Player's hand slightly shaking, float value rounding error, etc.
- A value between 0 and 1 is what
homingis intended for. The lower the value (closer to 0) the more permissive and imprecise the check; the higher the value (closer to 1) the more strict and precise the check. 0.5 is in-between (player looking up to 45° away from the specified direction).
0.6 or 0.7 is usually a good compromise, but higher values like 0.8 or 0.85 can work just as well if it's for a button, for example.
The homing property is applicable to:
- trigger_multiple
- trigger_once
- trigger_push
- trigger_secret
- trigger_take_weapon