# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/triad-infiltration-08-visualizing-players-holding-objectives-in-verse
# Local doc: epic-docs/documentation/en-us/fortnite/triad-infiltration-08-visualizing-players-holding-objectives-in-verse.md
# Section: Running a Race While Holding the Objective
# Causes the CaptureItemIndicator to continuously follow a player above their head.
# Races between the update loop for the CaptureItemIndictator, and whether the player
# captures the item, drops the item, or is eliminated.
FollowCharacter(FortCharacter:fort_character)<suspends>:void=
Logger.Print("Spawned FollowCharacter function")
race:
loop:
Transform := FortCharacter.GetTransform()
spawn{CaptureItemIndicator.MoveTo(Transform.Translation + vector3{Z := VerticalOffset}, Transform.Rotation, UpdateRateSeconds)}
spawn{MapIndicator.MoveTo(Transform.Translation + vector3{Z := VerticalOffset}, Transform.Rotation, UpdateRateSeconds)}
# We want to make sure this loop runs only once per simulation update, so we sleep for one game tick.
Sleep(0.0)
CaptureItemSpawner.ItemCapturedEvent.Await()
CaptureItemSpawner.ItemDroppedEvent.Await()
FortCharacter.EliminatedEvent().Await()
Logger.Print("Objective dropped or captured")
Verse Library
verse
12 Running A Race While Holding The Objective
Continuously updates UI indicators to track a player's position until an objective event occurs.
extracted-snippets/documentation/en-us/fortnite/triad-infiltration-08-visualizing-players-holding-objectives-in-verse/12-running-a-race-while-holding-the-objective.verse