Verse Library verse

01 Fragment

Retrieves every player in the playspace and prints their character's vertical position coordinate.

verse-library/verse-char-find-player/01-fragment.verse

# The chain from a device to a player's body:
Playspace := GetPlayspace()        # this device's playspace
AllPlayers := Playspace.GetPlayers()   # every human player in it
for (P : AllPlayers):
    if (Body := P.GetFortCharacter[]):  # the player's character (can fail)
        Where := Body.GetTransform().Translation
        Print("player at {Where.Z}")

Comments

    Sign in to vote, comment, or suggest an edit. Sign in