I’m trying to have a trigger return the player, but it’s not working. I have the var for fort character and that being set on Find player called at begin play. The issue I have is the subscribe thing isn’t happy and I can’t work out why.
If I do a ? in the below before fort the code is kind of happy except for the SetVulnerability. that then isn’t happy.
var MaybeFortCharacter : fort_character = false
Any idea would be amazing because it’s causing headaches with this verse code. C++ is actually better etc then this code language.
var MaybePlayer<private>:?player = false
var MaybeFortCharacter : fort_character = false
Logger<private>:log = log{Channel := log_SecretAgent}
@editable
Trigger:trigger_device = trigger_device{}
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
# TODO: Replace this with your code
Print("Begin Play Triggered")
FindPlayer()
Trigger.TriggeredEvent.Subscribe(PlayerInZone)
FindPlayer<public>():void =
if (Player := GetPlayspace().GetPlayers()[0], FortCharacter := Player.GetFortCharacter[]):
set MaybeFortCharacter = option{FortCharacter}
set MaybePlayer = option{Player}
PlayerInZone(FortCharacter:fort_character):void =
MaybeFortCharacter.SetVulnerability(false)