Pass ForgeDocs Product page

How do I

Ping a place on the radar and compass

Add a Ping step to a Pass Forge Moment, or call PassForgePings.Ping(position, color, shape), to mark a place on every Compass Bar and Fog of War Radar for a few seconds.

You want

A gunshot, an alarm or a teammate's call for help shows on the radar and the compass so the player turns toward it, with a sign that tells an enemy from a call for help at a glance.

Steps

  1. Open the moment of the event, such as the alarm's Pass Forge Moment, press Add Step and pick Ping. The Objective Marked, Show The Way, Shot Fired and Sonar Ping ready made moments already use it.
  2. Set Color and Shape: Warning, Enemy, Ally, Help, Objective, Sound, or Icon with an Icon of your own. Ring shows a pin.
  3. Set Seconds, and Ring Size, the meters the ring spreads to on a radar.
  4. Tick Reveal Enemies to show the enemies within the ring on every radar for the seconds, even out of sight, like a sonar.
  5. Set Offset to move the ping from the moment's position.
  6. Make sure Show Pings is on, on the Compass Bar and on the radar.
Inspector
Moment Inspector

What you should see

The ping shows on every Compass Bar and Fog of War Radar where the moment plays, however far away and even where the fog hides it. On a radar its ring spreads to its size; a ping out of range shows as a short arc just inside the border, toward it. Eight show at once, a new one replacing the oldest, and one close to a showing ping of the same color starts it again.

If it does not work

  • The ping shows only a ring on the compass. A ping on an object a Compass Bar already marks rings that marker instead of adding a second one.
  • Nothing shows. The step's inspector notes when the scene has no Compass Bar or Fog of War Radar; a HUD in a scene of its own still gets the pings. Check Show Pings on each.
  • A far ping seems weak. Range and Blocked By do not apply to pings: far events are what a compass and a radar are for.
  • The icon is missing. Pings share the eight icons Off-screen Indicators draw from; with all eight taken, a ping shows the ring alone.

From a script

using PassForge.Effects;
using UnityEngine;

public static class RadarPings
{
    // Close pings of one color merge, so a weapon can call this on every shot.
    public static void Shot(Vector3 muzzle) => PassForgePings.Ping(muzzle, new Color(1f, 0.32f, 0.22f), 2f, 6f);

    public static void EnemySpotted(Vector3 at) => PassForgePings.Ping(at, Color.red, PingShape.Enemy);

    // Follows a teammate while it shows.
    public static void Help(Transform ally) => PassForgePings.Ping(ally, Color.cyan, 5f, 8f, PingShape.Help);

    // Enemies within 25 m show on every radar for four seconds, even out of sight.
    public static void Sonar(Vector3 player) =>
        PassForgePings.Ping(player, new Color(0.4f, 0.9f, 1f), 4f, 25f, revealEnemies: true);
}

PassForgePings.Clear() clears every ping at once, such as on a respawn.