I want to make this verse code loop break when a player enters the mutator zone device and also when the explosive device has exploded. but a can’t figure it out at all.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Fortnite.com/Characters }
using { /UnrealEngine.com/Temporary/SpatialMath }
A Verse-authored creative device that can be placed in a level
AttachPlayer := class (creative_device):
@editable MutatorZone : mutator_zone_device = mutator_zone_device{}
@editable VFXPowerup : visual_effect_powerup_device = visual_effect_powerup_device{}
@editable ExplosiveDevice : explosive_device = explosive_device{}
@editable WhiteDisk : creative_prop = creative_prop{}
@editable VFXSpawner : vfx_spawner_device = vfx_spawner_device{} # aAdd the radio device
@editable VFXCreator : vfx_creator_device = vfx_creator_device{}
OnBegin<override>()<suspends>:void=
VFXPowerup.ItemPickedUpEvent.Subscribe(AttachToPlayer)
AttachToPlayer(Agent : agent) : void=
spawn:
AttachToPlayerNew(Agent)
AttachToPlayerNew(Agent: agent)<suspends> : void=
if(FC := Agent.GetFortCharacter[]):
loop:
Sleep(0.0)
PlayerPos := FC.GetTransform().Translation
PlayerRot := FC.GetTransform().Rotation
spawn{WhiteDisk.MoveTo(PlayerPos + vector3{Z:= -70.0},PlayerRot, 0.1)}
spawn{MutatorZone.MoveTo(PlayerPos, PlayerRot, 0.1)}
spawn{ExplosiveDevice.MoveTo(PlayerPos + vector3{Z:= 120.0}, PlayerRot, 0.1)}
spawn{VFXSpawner.MoveTo(PlayerPos + vector3{Z:= 70.0},PlayerRot, 0.1)} # Move the radio device
spawn{VFXCreator.MoveTo(PlayerPos + vector3{Z:= 120.0}, PlayerRot, 0.1)}