When Reaching Target
Fires when the distance to its target becomes smaller than the stopping distance set on the follower.
Introduction
When Reaching Target is an event in the Follower group of World Events. It fires when the distance to its target becomes smaller than the stopping distance set on the follower. When it fires, the event hands one value to your script: Object, the target that was followed. When the follower is chasing a player, this value represents that character. Like every event, it does nothing by itself. It waits for the right moment, then runs all the actions connected to it. This event belongs to the Follower component. Open the Follower component guide to see everything the component itself can do. Following is a journey with three beats: the walk starts with When Following Starts , progress is measured until this event fires at the destination, and the chase breaks with When Target is Lost . The component that drives pets and companions is documented in the Follower guide. When Reaching Target event in the World Editor Image The When Reaching Target event in the Script Editor. caption
Parameters
Object the target the follower reached Parameter Description
How to Access
How to Access - Event When Reaching Target
How to Use
Select the object, press Propertie (the blue equalizer icon) in the bottom action menu, and scroll to the bottom of the properties panel. Press Add Component and pick the Follower component; its block stacks below the existing properties with the When Reaching target event inside it. Press the + button below the event to add a script, then press Edit on that script to open the script editor and build the actions that should run when the event fires. Press Play and watch the object reach its target, then check that the actions run.
Example
When reaching target by Object in Event: Execute Object in Event, Character.Kill Auto Respawn True when-reaching-target-example.png Kills the reaching character with auto respawn when it reaches the target. caption
Common Uses
Have a pet pet its owner or play a greeting animation on arrival End a monster chase by despawning it once it catches the target Trigger a trap or ambush the moment the follower closes in on the target
Tip
The stopping distance on the follower decides when this event fires. Tighten it if your enemy should get closer before attacking.