I can get access to the agent
of the guard in the guard spawner spawned event. If this was a player I would cast it to a player
in order to get the fort_character
of the player. The agent of the guard doesn’t cast to player
. Does anyone know if getting afort_character
from the guard agent
is possible?
I’ve answered my own question here. I’ve managed to get the fort_character
of a guard by calling GetFortCharacter
directly on the agent
instead of casting to player
.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
guard_test_device_log := class(log_channel){}
guard_test_device := class(creative_device):
Logger : log = log{Channel:=guard_test_device_log}
@editable
GuardSpawner: guard_spawner_device = guard_spawner_device{}
OnBegin<override>():void=
GuardSpawner.SpawnedEvent.Subscribe(HandleGuardSpawned)
HandleGuardSpawned(Agent: agent):void=
Logger.Print("HandleGuardSpawned")
if(FortCharacter := Agent.GetFortCharacter[]):
Logger.Print("HandleGuardSpawned - found fort_character")
1 Like
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.