You would have to identify that player somehow, i.e. they would have to perform an action you can capture so you can store the Agent
in a custom device.
You can then respawn that Agent
at a specific location.
using { /Fortnite.com/Devices }
using { /Fortnite.com/FortPlayerUtilities }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }
player_respawner_device := class(creative_device):
# For example, pressing a button will be the action that registers a player to be respawned
# If could be anything that callbacks with an Agent
@editable
Button:button_device = button_device {}
# The transform to respawn the player at
# Alternatively, you could reference an in-world prop/device and call GetTransform() on it
@editable
Target:transform = transform {}
var RegisteredPlayer:?player = false
OnBegin<override>()<suspends>:void=
Button.InteractedWithEvent.Subscribe(RegisterPlayer)
RegisterPlayer(Agent:agent):void=
if(Player := player[Agent]):
# Here we store the last player that interacted with the button
set RegisteredPlayer = option {Player}
# Call this in your code when you want the player to respawn, or register it as a callback for a specific action
RespawnRegisteredPlayer():void=
if(PlayerToRespawn := RegisteredPlayer?):
PlayerToRespawn.Respawn(Target.Translation, Target.Rotation)
I hope that’s what you were after?