Player direction / bearing HUD /Overlay

Started by fuchsiashock on

Topic category: User side tutorials

Last seen on 17:02, 24. Jan 2021
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Player direction / bearing HUD /Overlay

I was struggling to get this to work and didn't find much joy searching so here is my solution to showing the player direction on screen as a hud display / overlay text

- create a global variable called playerdirection. It can be called anything but has to be global so it can be called from the OVERLAY screen in mcreator.

- make it a NUMBER

 

- In WORKSPACE, create a new PROCEEDURE

- Event trigger: on player tick

- Logic and loops > If Else

- If (Entity direction in deg. relative to S < 180)

- Do SET Global:playerdirection to (180 + Entity direction in deg. relative to S)

- Else If (Entity direction in deg. relative to S >= 180) 

- Do SET Global:playerdirection to (Entity direction in deg. relative to S - 180)

 

THEN

- Create a new OVERLAY

- Add Component > Text Label

- Choose your "VAR" variable from the list created earlier

- Put plain text either side of the variable if you want

- Put it where you want on screen

 

If you have a better solution, please share. I just kind of made this one up.