Common tasks and recipes
Short answers to "how do I...". Each points to the page with the details.
Show the player where to go next #
- Add a Waypoint to the target (Add Component > Bearing > Waypoint) and set its State to Active.
- Players see a marker on screen, an arrow at the edge with the distance, an icon on the compass and the minimap, and a pin on the full-screen map. Explorer also lights a beacon over it.
- When it's done, set the State to Completed (or use When Reached: Done) and make the next place Active. A Waypoint Chain does this for you (Chart Table, Chains tab). See Chart Table.
Hide places until they are found #
Set the place's State to Undiscovered and Discover to When Near or When Seen. Undiscovered places show as "?" (the style's States section). For "somewhere around here", give it a Search area (Discovery and fast travel). See Fog of war and region discovery.
A lookout tower that uncovers the map #
GameObject > Bearing > Region Reveal > Tower, move it onto your tower and set its radius. Or, on a Map Region, pick Revealed by: A lookout tower. See Towers, maps and story reveals.
Fast travel with a lock and a cost #
On the place, press Make it a travel point (Discovery and fast travel). Set When Place Completed and the place it
needs, and a Locked Reason. Costs: WaypointTravelPoint.Check = p => gold < 50 ? "Costs 50 gold" : null;. See
Players on the map.
A building with floors #
Give the building its own Waypoint Map with Is Area on and its floors (heights); press Bake All Floors. Players switch map automatically when they walk in. See Maps.
Change the whole look #
Pick a look on the HUD (Explorer, Tactical, Minimal, Holo), then Save as my own style and change anything. Fine-tune positions and sizes in the style's Layout section. See Make it yours.
Let players choose their own settings #
Players press O (or the map's Settings button). Choose what they may change and the slider limits with a Player
Options asset (Chart Table gear, The player's options). From your own menu: WaypointPlayerSettings.Current then
WaypointPlayerSettings.Apply(). See Players on the map.
The mouse cursor while playing #
Bearing frees and shows the cursor whenever something the player can click is up: the full-screen map and the player options. Players can also hold Alt at any time for a free cursor (to click the HUD's buttons) and let go to look around again; a small hint ("Esc or hold Alt for the cursor") shows for a few seconds each time the mouse is captured. In a browser build, if the page loses or never gets pointer lock (Esc, a refused request), the cursor comes back instead of staying hidden. On the Waypoint HUD:
- Cursor Policy: Free For Bearing Ui (the default, as above) or Game Owns It (Bearing leaves the cursor to your game; the map frees it only if Free Mouse On Map is on).
- Free Cursor Key: the key to hold (None for no key).
- Show Cursor When Free: turn off if your game draws its own cursor and hides the system one.
- Cursor Hint and Cursor Hint Text: the hint, and its words.
If your controller captures the mouse on a click, skip the capture while WaypointHud.WantsCursor is true, so the first
click on Bearing's map, options or buttons is a click.
Show it in another language #
Create a Text Table, press Collect Words, fill it in, set it on the HUD (More, Language). With Unity Localization add Waypoint Localization. See Code and your own UI.
Use my own HUD art or my own UI #
Your own icons: Icon = Custom and your sprite (Keep its own colours for full-colour pictures). Your own marker background
and arrow: the style's Marker and Edge Arrows sections. Your own UI for one part: turn Bearing's part off and add an
IWaypointDisplay (see Code and your own UI).
Save and load #
SaveService.Save("slot") and SaveService.Load("slot"), or WaypointSave.Capture() and Restore(json) with your
own save system. To try it: add Waypoint Save Keys (F5 and F9). See Trails, events and saving.
Split screen #
GameObject > Bearing > Split Screen (second player). See Fit it into your game.
Recipes from code #
// Mark a quest target when a quest starts, and clear it when the quest ends.
var w = target.AddComponent<Waypoint>();
w.Label = "Find the smith";
w.Icon = WaypointIcon.Talk;
w.State = PoiState.Active;
// ... later
w.State = PoiState.Completed;
// Open the map at a place (for a "show on map" button in your quest log).
hud.OpenMap();
hud.SearchMap("smith");
hud.PickSearchResult();
// Tell the player something in the HUD's own banner.
hud.ShowBanner("Bridge repaired", "Chapter 2");
// React to discoveries (an achievement, a sound of your own).
WaypointRegistry.AnyStateChanged += (place, from, to) =>
{
if (from == PoiState.Undiscovered) Achievements.Count("places");
};
A heartbeat near the objective #
Add Waypoint Sounds (on the HUD) and set Heartbeat to a short beat. Inside Heartbeat Range (40 m by default)
of the tracked place, or else the current objective, it beats, quicker the closer the player gets (Heartbeat Interval:
seconds between beats at the edge and right at the place). sounds.HeartbeatGap gives the gap now for your own effects.