Question - How do the new player variable functions work?

I just got UEFN access a couple of days ago so I’m a Verse noob in general, but I can’t seem to figure out the new player variable functions like GetMaxHealth() and SetMaxHealth(). Has anyone been able to use any of these functions?

You could do something like this:

using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Native }
using { /Verse.org/Simulation }
using { /EpicGames.com/Temporary/Diagnostics }

log_test_device := class(log_channel){}

test_device := class(creative_device):
    Logger:log = log{Channel:=log_test_device}

    # Runs when the device is started in a running game
    OnBegin<override>()<suspends>:void=
        
        allPlayers:[]player = GetPlayers()
        Logger.Print("Number of Players: {allPlayers.Length}")

         if (fortCharacter:fort_character = allPlayers[0].GetFortCharacter[]):
             Logger.Print("Character has {fortCharacter.GetHealth()} health")

Don’t forget the include using { /Fortnite.com/Characters }

1 Like

Thank you! Will try this out.

The GetPlayers function now resides under playspace.
Include using { /Fortnite.com/Playspaces }
Get playspace from the creative device itself, then get the array of players from GetPlayers()

allPlayers:[]player = Self.GetPlayspace().GetPlayers()

2 Likes