part:event:ranger

Ranger

Triggers based on distance. Ranger casts a ray starting at the location of the parent model, in the direction of the red positional arrow. Distance is the max length of the ray. Compare is the distance you want to compare to using an operator.

above

Ranger set to above will hide attached parts when the distance to an object is higher than compare.

below

Ranger set to below will hide attached parts when the distance to an object is lower than compare.

This behavior can be inverted by using invert.

nametypedescription

distance

number The max length of the ray. Needs to be higher than compare. The actual value only matters when using npcs_and_players_only (BUG?).

npcs_and_players_only

boolean Ignores world collision. Only triggers when a player or an NPC is detected.

compare

number The number that you want to compare the distance to.
  1. Add a dummy model to your outfit and attach the ranger event to it.
  2. Use the dummy to set a direction of the ranger. (Red arrow means forward)
  3. Enable affect children only and attach other parts to the event.

Set distance to 200, compare to 100, operator to above, the event will trigger when an object appears closer than 100 units away from you.

Download: event_ranger.txt


← Go back to Event

  • part/event/ranger.txt
  • Last modified: 2 months ago
  • by yagira