Having a little trouble understanding tags, I’m trying to access player spawners by assigning them tags. At the moment I have an object in game manager called PS1 and its assigned to one player spawner. Im trying to make that same player spawner accessible through a tag rather than through its object declaration.
For example, im trying to access all spawners with the tag ‘spawners’ however I cant seem to access my OnPlayerDamaged or maybe OnPlayerSpawned function without having that original PS1 object declaration.
spawner := class(tag){}
GameManager := class(creative_device):
@editable
# constant or variable
PS1:player_spawner_device = player_spawner_device{}
InitSpawners():void=
Spawners := GetCreativeObjectsWithTag(spawner{})
for(Obj: Spawners):
#loops through each spawner
if(Spawner := player_spawner_device[Obj]):
#Then checks if its a valid spawner
Spawner.SpawnedEvent.Subscribe(OnPlayerSpawned)
OnPlayerSpawned(Agent:agent):void=
if(FC:=Agent.GetFortCharacter):
#Provides access to different fortnite attributes, like the damage event
FC.DamagedEvent().Subscribe(OnPlayerDamaged)
#when player gets damaged, go to the damaged function.
Any tips help, thank you
Edit: I might’ve solved it, i think i just have to call in InitSpawners() in my OnBegin function to actually start the event