- Other5Compass built in
The compass comes in the Other5Compass plugin. CubeEscape's compass uses it too.
Put it on screen
- In your HUD, player controller or character Blueprint, on Begin Play, call Create Widget with the class Other5 Compass Widget, then Add to Viewport. It sits at the top middle.
- Set North Yaw to the world direction your map calls north (0 is the world's +X).
- To change where it sits, set Horizontal Placement, Vertical Placement and Screen Padding.
To keep your settings in one place, make a Widget Blueprint with Other5 Compass Widget as its parent class. Set its values in Class Defaults, and create that one instead.
Change its look
Every part of the look is in Style (an Other5 Compass Style). That covers its width and height, field of view, 8 or 4 point labels, font, tick spacing and size, every colour, the sizes of pips and icons, how faded markers outside the view are, and how fast markers pulse. To change the style while the game runs, call Set Style.
Show other players
Show Other Players is on by default: each other player gets a pip in one of the Player Colors. To pick who shows, override Should Show Player. Returning true only for your team is a common choice. To set each player's colour, icon or label, override Make Player Marker.
Mark things
A marker (Other5 Compass Marker) points at an Actor, a Location or a Fixed Bearing. It's drawn as a Pip with a label, a Tick or an Icon (a texture or material), with a Color, Size, optional Pulse and a Max Distance. There are three ways to add one:
- On an actor: add the Other5 Compass Marker component to any actor Blueprint, such as an objective or a door, and set its Marker. It shows on every compass. When it's done, call Set Show On Compass (false) to hide it.
- By class: add entries to the widget's Actor Classes (a class and a marker). Every actor of that class shows. Actor Scan Seconds sets how often it looks for new ones.
- By name, from any Blueprint: get the Other5 Compass Subsystem and call Add Marker with a name. Use Remove Marker or Clear Markers to take markers off. For markers on one compass only, the widget has its own Add, Remove and Clear Markers.
Good to know
- Markers are per player, not sent over the network. Add them on each player's machine, for example from Begin Play on an actor that every machine has.
- Get Bearing and Get Bearing To give you directions for your own UI, such as "Exit: NE".
- To make the compass follow something other than the camera, override Get View Rotation and Get View Location.