Is there a way for the player not to be injured by moving objects such as an elevator?
I want the player to go up in an elevator, but obvs when they’re in the elevator cab as it moves up, it’s damaging the player as well. I don’t want the player to be invincible throughout, though.
I have been told about the ability to change the vulnerability of players in verse code. However, the issue I now face is I am trying to set a reference to the Fort_Character so that I can grab it once and have it for the rest of the code.
I’m struggling to do this, though, as I can’t work out how to define the variable.
var MaybePlayer<private>:?player = false
Logger<private>:log = log{Channel := log_SecretAgent}
FortChar<public>: fort_character = fort_character
@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<private>():void =
Players:[]player := Self.GetPlayspace().GetPlayers()
PlayerInZone<private>():void =
Players:[]player := Self.GetPlayspace().GetPlayers()
for(P : Players):
if (FortChar := P.GetFortCharacter[]):
FortChar.SetVulnerability(false)
```