# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/prop-hunt-03-playing-effects-on-idle-players-in-unreal-editor-for-fortnite
# Local doc: epic-docs/documentation/en-us/fortnite/prop-hunt-03-playing-effects-on-idle-players-in-unreal-editor-for-fortnite.md
# Section: Playing Effects On Idle Players
# If the prop agent stops moving then race to see if the prop agent moves beyond the MinimumMoveDistance, the heartbeat timer completes, or the prop agent is eliminated.
RunPropGameLoop(PropAgent:agent)<suspends>:void =
Logger.Print("Starting prop agent game loop.")
# Loop forever through the prop behavior until the prop agent is eliminated or the player leaves the session.
loop:
# Wait until the prop agent moves less than the minimum distance, then advance.
PropAgent.AwaitStopMoving(MinimumMoveDistance)
# Until the prop agent moves beyond the minimum distance, countdown to the heartbeat and then play the heartbeat indefinitely.
race:
PropAgent.AwaitStartMoving(MinimumMoveDistance)
block:
CountdownTimer(PropAgent)
PropAgent.StartHeartbeat()
Sleep(0.0) # Once the race completes (the prop agent moves), start the loop again.
Verse Library
verse
12 Playing Effects On Idle Players
Monitors agent movement to detect idling, then triggers a countdown and heartbeat effect sequence.
extracted-snippets/documentation/en-us/fortnite/prop-hunt-03-playing-effects-on-idle-players-in-unreal-editor-for-fortnite/12-playing-effects-on-idle-players.verse