Last semester, I created a prototype of the star navigation scene that:
- Lets the player rotate around the night sky
- Pan the camera up and down
- Check the direction they are facing for a correct value
But there are a few things needed to build on this:
- Be able to have multiple correct values
- As there are multiple islands the player can sail to
- Show a UI prompt that asks the player if they are sure of their decision
- And allow them to re-do their choice
- Show the player what direcion they are facing
Having multiple correct values
As I know where the destinations are (And how many there are) I can create integers and Serialize them to set them in the inspector:

These will be the values that are checked for when the player chooses the direction they want to go to:

Choosing the wrong direction
However, if the player chooses the wrong direction, the player needs to be informed they went the wrong way – and then given the opportunity to make the correct choice:

Which is done in this FailedToSail() Coroutine, which calls a method that activates a UI gameobject that tells the player their choice was incorrect:

Showing a UI prompt to confirm the player’s choice
For this I have to create a UI prompt with a button that calls a method that either allows the player to choose another direction, or confirms their direction choice. This is done with buttons that call either the ConfirmDirection() method (Shown in a screenshot above) or the DisableChoiceUI() method.




The reason for disabling the checkUIOn bool is because the bool prevents the direction from being chosen as soon as the confirmation UI is disabled.
Navigating the confirmation UI
Similarly to the menu that was documented in this post, I used Unity’s Event System to call the SetSelectedGameObject() method to select the buttons in the confirmation UI:

I then disable the SetSelectedGameObject() method by inputting null whenever the confirmation UI is disabled:

Showing the player what direction they are facing
As I researched in the first semester, the Ancient Polynesians used a mental compass to help them read the night sky. I wanted to simulate this in the star navigation scene:
To do this I created a UI gameobject that would rotate as the night sky gameobject rotated, allowing the player to keep track of the angle of their direction:

This object would rotate in increments of 32, as ancient Polynesians used a mental compass that divided the night sky into 32 total divisions:


Leave a Reply