# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/prop-hunt-02-playing-visual-effects-on-players-in-unreal-editor-for-fortnite
# Local doc: epic-docs/documentation/en-us/fortnite/prop-hunt-02-playing-visual-effects-on-players-in-unreal-editor-for-fortnite.md
# Section: Play Heartbeat Effects at a Location
# The heartbeat_vfx class contains a struct of data to track the VFX's root and vfx_spawner_device objects per player as well as the functions to set the VFX to a position or reset it.
heartbeat_vfx := class<concrete>:
@editable # The VFX device for each heart beat.
VFXDevice:vfx_spawner_device = vfx_spawner_device{}
# This offset is used to position the heartbeat above a prop agent's head.
HeartBeatVFXOffset:vector3 = vector3{X := 0.0, Y := 0.0, Z := 110.0}
# Sets the position of the heartbeat VFX and then enables the VFX.
Activate(Transform:transform):void =
VFXPosition := Transform.Translation + HeartBeatVFXOffset
if (VFXDevice.TeleportTo[VFXPosition, Transform.Rotation]):
VFXDevice.Enable()
# Disables the VFX, hiding the heartbeat visuals.
Deactivate():void =
VFXDevice.Disable()
Verse Library
verse
04 Play Heartbeat Effects At A Location
Defines a configurable class to spawn and position heartbeat visual effects above agents.
extracted-snippets/documentation/en-us/fortnite/prop-hunt-02-playing-visual-effects-on-players-in-unreal-editor-for-fortnite/04-play-heartbeat-effects-at-a-location.verse