Compass Navigator Pro supports multiple compass instances in the same scene (up to 4). Each instance can show different POIs and use its own viewport area, useful for split-screen multiplayer, multiple camera views, or separate UI layers. Instances are organized into groups (1–4), and POIs register with instances based on their group assignment.
- Compass Group: Set the group ID (1–4). POIs with matching group masks register with this instance.
- Viewport Rect: Normalized screen coordinates (0–1) defining the instance’s screen area. For split-screen, use (0,0,0.5,1) for the left half and (0.5,0,0.5,1) for the right half.
- Compass Group Mask: Bitmask selecting which compass groups (1–4) display this POI. Default 0xF (15) shows on all groups. Use bitwise values: 0x1 (1) for group 1 only, 0x2 (2) for group 2 only, 0x3 (3) for groups 1 and 2, etc.
POIs register automatically based on their compassGroupMask. To control registration programmatically:
- Register a POI to a specific compass group: set the POI’s compassGroupMask to target that group, then call RegisterPOI():
// Register POI to compass group 1 only
poi.compassGroupMask = 0x1; // Binary: 0001
poi.RegisterPOI(); - Register a POI to multiple compass groups: set the bitmask to include multiple groups:
// Register POI to compass groups 1 and 2
poi.compassGroupMask = 0x3; // Binary: 0011 (groups 1 and 2)
poi.RegisterPOI(); - Register a POI to all compass instances: Use the default mask or set it explicitly:
// Register POI to all compass groups (1, 2, 3, and 4)
poi.compassGroupMask = 0xF; // Binary: 1111 (not needed, as it’s the default value)
poi.RegisterPOI();
The RegisterPOI() method on the POI component automatically finds all active compass instances and registers the POI with those whose group matches the POI’s compassGroupMask. You can also call CompassPro.instance.POIRegister(poi) directly, which performs the same automatic matching. To unregister a POI, call poi.UnRegisterPOI(), which removes it from all matching compass instances.