Forum Discussion

LNATIONDEV's avatar
LNATIONDEV
Partner
6 months ago
Solved

Understanding the rooftop racers demo

Hello,

Unsure this is the correct forum to ask this question, it seems you can only have access to one at a time which is a bit silly but any ways. I've just downloaded the sample "rooftop racers" world and I'm looking at the the double jump logic. I see the relevant logic inside PlayerLocalController script that actually implements the double jump. I think I understand the toggle stuff between player and server running. However what is confusing me is in the world there are 8 objects configured with the script attached. Setup like you have to attach the object/script to the player when they enter the game. Is this truthful and where can I find that logic which attaches the player to the object?  

  • I followed the code from the event OnDisplayHintHUD, this led me to sysPuzzleEnter that handles players joining. Players are passed in that event and then the HUD are attached. It's a bit convoluted but makes sense. I will sleep better tonight now I understand this. 

2 Replies

  • I decided to look for other examples, and found this tutorial Module 2 - The HUD System | Horizon Worlds that says to  "verify that you have one HUD entity for each possible player in your world." but after reading the tutorial in full and inspecting the code it's no clearer how a HUD in this case is attached to the incoming player. Just looking for the event/lines that actually do this action.

    • LNATIONDEV's avatar
      LNATIONDEV
      Partner

      I followed the code from the event OnDisplayHintHUD, this led me to sysPuzzleEnter that handles players joining. Players are passed in that event and then the HUD are attached. It's a bit convoluted but makes sense. I will sleep better tonight now I understand this.