Get the current player

How do I access. The current player. For example let’s say I want to display the current position of the player in X, Y and Z on the HUD with UI. How would I proceed to access the player’s object.

1 Like

So you would need to get a player’s instigation somehow either with devices or do something with GetPlayspace().GetPlayers() (or GetPlayspace().PlayerAddedEvent.Subscribe(FunctionHere))

Then after you have the agent/player you will need to get its fortcharacter by doing:

if(FortCharacter:=Agent.GetFortCharacter[]):
      FortCharacter.GetTransform()

that should give you the transform of the character and then you can further open it’s translation and get the X,Y,Z values from it and put it inside verse UI or wherever you desire.

When you first type the GetFortCharacter it will show you an error saying to put using {…} just copy paste that message and put it at the top of your script

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.