class: ActorLocator

Specialized locators for querying and interacting with spatial 3D objects in the Unreal world. Extends the base SpecterLocator and features native Gameplay Ability System (GAS) integration.

actor.getLocation

Retrieves the current 3D world coordinates of the actor.

Usage

const startPos = await enemy.getLocation();

Returns

actor.waitForGameplayTag

Waits until the actor possesses the specified Gameplay Tag. Useful for verifying status effects like stuns or buffs.

Usage

await player.waitForGameplayTag("Status.Stunned");

Arguments

  • tagstring
    The exact Gameplay Tag string to wait for.

Returns

  • Promise<void>

actor.triggerAbilityByTag

Locates an ability on the actor's Ability System Component that matches the tag and explicitly triggers it.

Usage

await player.triggerAbilityByTag("Ability.Slot.Q");

Arguments

  • tagstring
    The tag identifying the ability (e.g. Ability.Slot.Q).

Returns

  • Promise<void>

Transform & Spatial

Methods for interacting with the actor's 3D position and rotation in the world.

actor.getLocation

Retrieves the actor's current 3D world location.

Usage

const pos = await player.getLocation();
console.log(pos.x, pos.y, pos.z);

Returns

actor.getForwardVector

Retrieves the actor's normalized forward directional vector.

Usage

const forward = await player.getForwardVector();

Returns

actor.setLocation

Teleports the actor to a new 3D world location.

Usage

await player.setLocation({ x: 0, y: 0, z: 1000 });

Arguments

  • locationVector3
    The target {x, y, z} coordinate.

Returns

  • Promise<void>

actor.setRotation

Teleports the actor to a new rotation.

Usage

await player.setRotation({ pitch: 0, yaw: 90, roll: 0 });

Arguments

  • rotationRotator
    The target {pitch, yaw, roll} rotation.

Returns

  • Promise<void>

actor.setTransform

Teleports the actor to a new full transform (location, rotation, and scale).

Usage

await player.setTransform({ location: { x: 0, y: 0, z: 0 }, rotation: { pitch: 0, yaw: 0, roll: 0 }, scale: { x: 1, y: 1, z: 1 } });

Arguments

  • transformTransform
    The target transform object.

Returns

  • Promise<void>

State & Testing

actor.highlight

Visually highlights the actor in the engine using a debug wireframe and floating text. Extremely useful for debugging tests visually!

Usage

await boss.highlight("Target Acquired!");

Arguments

  • stateInfostring(optional)
    Text to float above the actor.

Returns

  • Promise<void>

actor.checkVisibility

Checks if the actor's mesh is actively rendering. If checkOnScreen is true, verifies it is within the camera frustum.

Usage

const isVisible = await boss.checkVisibility(true);

Arguments

  • checkOnScreenboolean(optional)
    Whether to require it to be on-screen.

Returns

  • Promise<boolean>

actor.isLocallyControlled

Returns a new narrowed locator that filters the current set of actors down to only those possessed by the local human player. Perfect for filtering out AI Bots in Lyra!

Usage

const localPlayer = world.actor('BP_Hero_Shooter').isLocallyControlled(true);

Arguments

  • locallyControlledboolean(optional)
    Whether to filter for locally controlled (true) or non-locally controlled (false).

actor.getPlayerId

Retrieves the unique Player ID associated with the actor's PlayerState.

Usage

const id = await player.getPlayerId();

Returns

  • Promise<number>

actor.getByComponent

A locator for one of this actor's components, by class name (or with options.name, by component name). Use it to call functions or read properties on the component itself.

Usage

const health = player.getByComponent("HealthComponent");
await health.callFunction("Heal", { Amount: 50 });

Arguments

  • componentTypestring
    The component's class name (e.g. 'HealthComponent').
  • optionsobject(optional)
    Filters like name or exact UE class.

Actor-Scoped Widgets (UI)

Methods for locating 3D/Screen-space UWidgetComponents and their hosted UMG widgets directly on this actor.

actor.widget

Scopes down to any UMG widget hosted on this actor (via a UWidgetComponent or widget property). If no class name is provided, matches the primary hosted widget.

Usage

// Grabs the widget from Knight's UWidgetComponent:
const healthBar = knight.widget();
await expect(healthBar).toBeVisible();

Arguments

  • widgetClassOrNamestring(optional)
    The specific UMG widget class to find.

Returns

  • WidgetLocator<W>

actor.widgetComponent

Scopes to a specific UWidgetComponent by its Unreal component name and returns its underlying UUserWidget.

Usage

const healthBar = knight.widgetComponent("HealthBarComponent");

Arguments

  • componentNamestring(optional)
    The Unreal component name (e.g. 'HealthBarComponent').

actor.getByRole

Traverses directly into the actor's hosted widgets to find child elements by semantic role ('image', 'button', 'text', 'progressbar', etc.).

Usage

const healthImage = knight.getByRole("image", { name: "HealthBarImage" });
await expect(healthImage).toBeVisible();

Arguments

  • roleWidgetRole
    The semantic UI role.
  • optionsWidgetRoleOptions(optional)
    Role options like { name: 'HealthBarImage', exact: false }.

actor.pin

Resolves any dynamic query (such as .last(), .first(), .nth()) once on the engine, attaches a unique tag, and registers it into the engine's O(1) fast-path lookup table. Returns an ActorLocator pinned to that exact actor instance.

Usage

// 1. Resolve and pin the current last minion in the level:
const targetMinion = await world.actor("BP_MinionRange").last().pin();

// 2. High-frequency polling now executes in O(1) ~0.001ms time:
await expect(targetMinion).toHaveLocation({ x: 100, y: 200, z: 92 });

// 3. Spawning new minions will not hijack targetMinion:
await world.spawnActor("BP_MinionRange");
await targetMinion.highlight("Still Original Minion");

Returns

actor.destroy

Explicitly programmatically destroys the targeted actor in the Unreal Engine world.

Usage

await fireHazard.destroy();
await expect(fireHazard).toBeDestroyed();

Returns

  • Promise<void>

actor.getControllerInfo

Retrieves comprehensive controller and possession state information for the actor.

Usage

const info = await actor.getControllerInfo();
console.log(info.isPossessed);        // true
console.log(info.isPlayerControlled); // false (AI bot)
console.log(info.controllerClass);    // "BP_BossAIController"

Returns

  • Promise<ControllerInfo>

actor.isPossessed

Checks whether the Pawn is currently possessed by any active Controller (AI or Human).

Usage

const possessed = await minion.isPossessed();

Returns

  • Promise<boolean>

actor.isPlayerControlled

Checks whether the Pawn is possessed specifically by a human player (PlayerController) rather than an AI Controller.

Usage

const isHuman = await player.isPlayerControlled();

Returns

  • Promise<boolean>

Gameplay Ability System (GAS)

actor.getAttributeValue

Reads the current float value of a GAS Attribute.

Usage

const health = await player.getAttributeValue("HealthSet", "Health");

Arguments

  • attributeSetstring
    The Attribute Set class name.
  • attributeNamestring
    The specific attribute name.

Returns

  • Promise<number>

actor.hasGameplayTag

Checks if the actor's Ability System Component currently possesses the specified Gameplay Tag.

Usage

const isStunned = await player.hasGameplayTag("Status.Stunned");

Arguments

  • tagstring
    The tag to check.

Returns

  • Promise<boolean>

actor.getGameplayTags

Returns all Gameplay Tags currently owned by the actor's Ability System Component via IGameplayTagAssetInterface.

Usage

const tags = await enemy.getGameplayTags();
console.log(tags); // ['Status.Stunned', 'Status.Burning']

Returns

  • Promise<string[]>

actor.waitForGameplayTag

Waits asynchronously for a Gameplay Tag to be added or removed from the actor.

Usage

// Wait for the stun tag to be applied
await boss.waitForGameplayTag("Status.Stunned", true);

Arguments

  • tagstring
    The tag to wait for.
  • expectedStateboolean
    True to wait for addition, false to wait for removal.
  • timeoutnumber(optional)
    Timeout in milliseconds (Default: 5000).

Returns

  • Promise<boolean>

actor.waitForAttributeValue

Waits for a Gameplay Attribute to reach a specific value, tracking its history.

Usage

const result = await player.waitForAttributeValue("HealthSet", "Health", 0);
console.log("Health dropped to 0! History:", result.history);

Arguments

  • attributeSetstring
    The Attribute Set class name.
  • attributeNamestring
    The specific attribute name.
  • expectedValuenumber
    The value to wait for.
  • timeoutnumber(optional)
    Timeout in milliseconds (Default: 5000).

Returns

  • Promise<{ finalValue: number, history: number[] }>

actor.triggerAbilityByTag

Triggers a Gameplay Ability on the actor by its input tag.

Usage

await player.triggerAbilityByTag("Ability.Attack.Melee");

Arguments

  • inputTagstring
    The ability input tag.

Returns

  • Promise<void>

actor.triggerAbilityWithTarget

Triggers a Gameplay Ability and passes a target data payload (either an ActorLocator or a Vector3 location).

Usage

await player.triggerAbilityWithTarget("Ability.Spell.Fireball", boss);

Arguments

  • abilityTagstring
    The ability tag.
  • targetSpecterLocator | Vector3
    The target locator or 3D coordinate.

Returns

  • Promise<void>

actor.applyGameplayEffect

Directly applies a Gameplay Effect class to the actor's Ability System Component.

Usage

await player.applyGameplayEffect("/Game/Effects/GE_Damage_Poison.GE_Damage_Poison_C");

Arguments

  • effectClassPathstring
    The class path of the Gameplay Effect.
  • levelnumber(optional)
    The effect level (Default: 1.0).

Returns

  • Promise<void>

actor.hasActiveGameplayEffect

Checks if a specific Gameplay Effect class is currently active on the actor.

Usage

const isPoisoned = await player.hasActiveGameplayEffect("/Game/Effects/GE_Damage_Poison.GE_Damage_Poison_C");

Arguments

  • effectClassPathstring
    The class path of the Gameplay Effect.

Returns

  • Promise<boolean>

Input Simulation

actor.playSequence

Plays a mathematically accurate frame-by-frame SpecterInputSequence directed at this actor's input component.

Usage

import { SpecterInputSequence } from '@specter-automation/test';

const accelerate = new SpecterInputSequence()
    .addAxisSweep('Gamepad_RightTrigger', 0.0, 1.0, 0, 2000);

await playerCar.playSequence(accelerate);

Arguments

  • sequenceSpecterInputSequence
    The input sequence to play.
  • optionsObject(optional)
    { loops?: number } The number of times to loop the sequence.

Returns

  • Promise<void>

actor.tapKey

Taps a key on this actor's PlayerController: presses it, holds it for a few frames, then releases it, like a real keystroke. Use it for actions bound to Started or Completed (jump, interact, fire). Unreal needs the press and the release in different frames, so the default hold is 100 ms.

Usage

// Jump
await player.tapKey("SpaceBar");

// A longer tap, for input triggers that need a minimum hold
await player.tapKey("Gamepad_FaceButton_Bottom", { holdMs: 500 });

Arguments

  • keyUnrealKey
    The UE key name (e.g. 'SpaceBar', 'E', 'Gamepad_FaceButton_Bottom').
  • optionsObject(optional)
    { holdMs?: number, bHideStep?: boolean } How long to hold the key before releasing it (default 100 ms), and whether to hide the step in the report.

Returns

  • Promise<void>

actor.pressKey

Sends a single key event to this actor's PlayerController. A 'Pressed' key stays held until you send 'Released', so use it to hold keys (sprint, charge, aim) and use tapKey for a simple keystroke. Specter releases any key a test leaves held when the test ends, so held keys never leak into the next test or a retry.

Usage

// Hold Shift to sprint, then let go
await player.pressKey("LeftShift");
await expect(player).toHavePropertyValue("bIsSprinting", true);
await player.pressKey("LeftShift", "Released");

// Hold W until the player reaches the goal; Specter releases it for you
await player.pressKey("W", "Pressed", {
  until: async () => (await player.getDistanceTo(goal)) < 100,
  timeout: 10000,
});

Arguments

  • keyUnrealKey
    The UE key name (e.g. 'LeftShift', 'Gamepad_RightTrigger').
  • eventType'Pressed' | 'Released'(optional)
    Which event to send. Defaults to 'Pressed'.
  • optionsboolean | InputConditionalOptions(optional)
    Pass true to hide the step in the report. Or pass { until?, while?, when?, timeout?, intervalMs? } to hold the key until (or while) a condition holds, then release it automatically. timeout defaults to 5000 ms.

Returns

  • Promise<void>

actor.holdKey

Holds a key until (or while) a condition holds, then releases it. Shorthand for pressKey(key, 'Pressed', options).

Usage

await player.holdKey('W', {
  until: async () => (await player.getDistanceTo(goal)) < 100,
  timeout: 10000,
});

Arguments

  • keyUnrealKey
    The key to hold.
  • optionsInputConditionalOptions
    { until?, while?, when?, timeout? (default 5000), intervalMs? }

Returns

  • Promise<void>

actor.injectAxis

Injects a raw analog value directly into this specific actor's Input Component. Ideal for simulating fine analog movements like slightly tilting a gamepad thumbstick or partially pulling a trigger.

Usage

// Pull the right trigger 10% on a specific player's controller
await playerActor.injectAxis('Gamepad_RightTrigger', 0.1);

Arguments

  • axisNamestring
    The name of the axis binding (e.g. 'Gamepad_RightTrigger').
  • valuenumber
    The float value to inject (typically -1.0 to 1.0).

Returns

  • Promise<void>

actor.type

Simulates typing a string of text sequentially by sending Pressed and Released events for each character.

Usage

await player.type("Hello Specter!");

Arguments

  • textstring
    The string of text to type.
  • delayMsnumber(optional)
    Optional delay between keystrokes.

Returns

  • Promise<void>

Enhanced Input

Methods for querying and triggering UE5 Enhanced Input Subsystem actions and mapping contexts.

actor.triggerInputAction

Triggers a UE5 Enhanced Input Action (UInputAction) on the actor's Enhanced Input Local Player Subsystem.

Usage

// Trigger a digital jump action
await player.triggerInputAction('IA_Jump', true);

// Trigger a 2D analog movement vector payload
await player.triggerInputAction('IA_Move', { x: 0.0, y: 1.0, z: 0.0 });

Arguments

  • actionstring
    The Input Action asset name or path (e.g. 'IA_Jump', 'IA_Move').
  • valueboolean | number | Vector3
    The input action value payload.

Returns

  • Promise<void>

actor.hasInputMappingContext

Checks whether a UE5 Input Mapping Context (UInputMappingContext) is actively applied to the player's Enhanced Input Subsystem.

Usage

const hasIMC = await player.hasInputMappingContext("IMC_DefaultPlayer");

Arguments

  • contextstring
    Short context asset name (e.g. 'IMC_DefaultPlayer') or full asset path.

Returns

  • Promise<boolean>

actor.getInputActionValue

Retrieves the current evaluated value of a UE5 Enhanced Input Action.

Usage

const info = await player.getInputActionValue("IA_Sprint");
console.log("Bool state:", info.boolValue);

Arguments

  • actionstring
    Short action asset name (e.g. 'IA_Sprint') or asset path.

Returns

  • Promise<{ value: number, boolValue: boolean, vector: Vector3 }>

Camera & FOV

Methods for querying and controlling camera properties, field of view, and camera shakes.

actor.getCameraFOV

Retrieves the current Field of View angle from the actor's camera component, player camera manager, or the actor's own camera.

Usage

const fov = await player.getCameraFOV(); // default: 90

Returns

  • Promise<number>

actor.setCameraFOV

Sets the Field of View angle on the actor's camera component, camera manager, or the actor's own camera.

Usage

await player.setCameraFOV(110);

Arguments

  • fovnumber
    The FOV angle in degrees.

Returns

  • Promise<void>

actor.isCameraShaking

Checks whether the actor's PlayerCameraManager currently has any active camera shakes playing.

Usage

const shaking = await player.isCameraShaking();

Returns

  • Promise<boolean>

actor.getCameraViewTarget

Returns the name of the actor currently being viewed through this actor's camera.

Usage

const target = await player.getCameraViewTarget();

Returns

  • Promise<string>

AI & Navigation

Methods for querying AI pathfinding state and navigation goals.

actor.isAINavigating

Checks whether the actor's AI Controller is currently navigating along a path (PathFollowingStatus is Moving). Automatically resolves from Pawn to Controller.

Usage

const navigating = await aiPawn.isAINavigating();

Returns

  • Promise<boolean>

actor.getAINavGoal

Retrieves the current navigation destination from the actor's AI Controller's PathFollowingComponent.

Usage

const goal = await aiPawn.getAINavGoal();
console.log(goal.x, goal.y, goal.z);

Returns

actor.isRunningBehaviorTree

Whether the actor's AI runs this behavior tree (asset name or path). To wait for it, use expect(actor).toBeRunningBehaviorTree().

Usage

const guarding = await guard.isRunningBehaviorTree('BT_Guard');

Arguments

  • treePathstring
    The behavior tree's asset name or path.

Returns

  • Promise<boolean>

actor.aiController

A locator for the AI controller possessing this pawn: blackboard reads, callFunction and getProperty then act on the controller. The AI matchers accept the pawn too, and callFunction on a pawn falls back to its controller, so you rarely need it.

Usage

const brain = minion.aiController();

Returns

  • AiControllerLocator

actor.getBlackboardValue

Reads a blackboard key of the actor's AI. The result's value is the key as text; for an object key, toActor() returns a locator for that actor (or null when the key is empty).

Usage

const target = await tower.getBlackboardValue('Target');
console.log(target.value);
const targetActor = await target.toActor();

Arguments

  • keyNamestring
    The blackboard key.

Returns

  • Promise<BlackboardValueResult>

actor.getBlackboardActor

Shortcut for getBlackboardValue(key).toActor(): the actor an object key points at, or null.

Usage

const target = await tower.getBlackboardActor('Target');
await expect(target!).toHaveTeamId(2);

Arguments

  • keyNamestring
    The blackboard key.

Returns

  • Promise<ActorLocator | null>

actor.getBehaviorTrail

What this AI did during the test: the node its behavior tree is running (or its StateTree's active states), its blackboard, and its recent changes. describeBehaviorTrail(trail) turns it into readable lines. See AI Debugging.

Usage

import { describeBehaviorTrail } from '@specter-automation/test';

const trail = await minion.getBehaviorTrail();
console.log(trail.activePath);   // ['Root', 'Combat', 'Attack']
console.log(describeBehaviorTrail(trail));

Arguments

  • optionsObject(optional)
    { limit?: number } the most recent changes to return (default 20).

Returns

actor.aiPerceives

Whether this AI's sight perceives the target, and if not, why: out of range, outside its view angle, a team it doesn't detect, or something in the way (with what). Also returns the distance, angle, attitude, sight settings, when sight last sensed it and the trace. See Debugging Tools.

Usage

const seen = await guard.aiPerceives(intruder);
if (!seen.perceived) console.log(seen.reason);
// 'Out of range: 2150 away, sight radius 1500.'

Arguments

Returns

actor.getNavPath

The navmesh path from this actor to a point or another actor: whether each end is on the navmesh, found or partial (and how far short it stops), length and corners, and what its AI's path following is doing now. See Debugging Tools.

Usage

const path = await minion.getNavPath({ x: 4000, y: 0, z: 0 });
console.log(path.summary);   // 'Partial path: it ends 640 short of the goal (3310 long).'

Arguments

  • goalVector3 | ActorLocator
    Where to find a path to.

Returns

Collision & Traces

What blocks a line, how an actor's components collide, and what overlaps it. Channels are named as your project names them. See Debugging Tools.

actor.traceTo

Traces a line from this actor to another actor or a point and reports the first thing that blocks it, with its component, collision profile and object type, plus a one-line summary. The actor itself is ignored.

Usage

const trace = await turret.traceTo(player, { channel: 'AISight', fromEyes: true });
if (!trace.clear) console.log(trace.summary);

Arguments

  • targetActorLocator | Vector3
    Where the line goes.
  • optionsObject(optional)
    • channelstring(optional)Defaults to 'Visibility'
      A trace or object channel by name: Visibility, Camera, AISight (the AI System's sight channel), one of your project's channels, or an ECC_ name.
    • fromEyesboolean(optional)Defaults to true
      Start at the actor's eyes (its view point); false starts at its location.

Returns

actor.hasLineOfSightTo

Whether nothing blocks the line from this actor to the target. Takes the same channel option as traceTo. To wait for it, use expect(actor).toHaveLineOfSightTo().

Usage

expect(await turret.hasLineOfSightTo(player, { channel: 'Camera' })).toBe(true);

Arguments

  • targetActorLocator
    The other actor.
  • optionsObject(optional)
    { channel?: string }

Returns

  • Promise<boolean>

actor.getCollisionResponses

Every collision component of the actor: its collision profile, whether collision is query-only or physics, its object type, whether it generates overlap events and affects navigation, and its response (Block, Overlap or Ignore) to each channel, or only to the one asked about.

Usage

const components = await pickup.getCollisionResponses({ channel: 'Pawn' });
expect(components.find((c) => c.component === 'PickupSphere')?.responses['Pawn']).toBe('Overlap');

Arguments

  • optionsObject(optional)
    { channel?: string } just this channel's response.

Returns

actor.getOverlappingActors

What overlaps this actor now, component by component. Its own components overlapping each other are left out.

Usage

const { actors } = await world.actor('BP_CaptureZone').getOverlappingActors();
expect(actors).toContain('BP_Hero_C_0');

Returns

Team System

Methods for querying the Generic Team Agent Interface (IGenericTeamAgentInterface).

actor.getTeamId

Returns the Generic Team ID of the actor. Checks the actor first, then the pawn's controller. Returns 255 for NoTeam.

Usage

const teamId = await player.getTeamId(); // 255 = NoTeam

Returns

  • Promise<number>

actor.getTeamAttitudeTowards

Evaluates this actor's team attitude towards another actor using the Generic Team Agent Interface.

Usage

const attitude = await player.getTeamAttitudeTowards(enemy);
// Returns: 'Friendly' | 'Hostile' | 'Neutral'

Arguments

  • otherActorActorLocator
    The other actor to evaluate attitude towards.

Returns

  • Promise<string>

Visual Debugging & Overlays

Real-time viewport overlays, motion trail ribbons, direction arrows, and auto-updating stats billboards.

actor.drawTrail

Draws a real-time persistent 3D ribbon connecting the actor's positions as they move through the world.

Usage

await player.drawTrail({
  duration: 6,           // How long trail recorder runs (seconds)
  color: 'cyan',         // 'cyan' | 'magenta' | 'yellow' | 'red' | 'green' | hex (#RRGGBB)
  thickness: 4.0,        // Line thickness in viewport
  segmentDuration: 12.0  // Persistence of each drawn ribbon segment
});

Arguments

  • optionsTrailOptions(optional)
    Configuration object: { duration?: number, color?: string, thickness?: number, segmentDuration?: number }.

Returns

  • Promise<void>

actor.drawDirectionArrow

Draws a 3D arrow indicating the actor's forward facing direction or instantaneous velocity vector.

Usage

// Forward facing vector arrow
await player.drawDirectionArrow({ length: 200, color: 'cyan', duration: 5 });

// Velocity vector arrow
await player.drawDirectionArrow({ length: 200, color: 'yellow', duration: 5, useVelocity: true });

Arguments

  • optionsDirectionArrowOptions(optional)
    Configuration object: { length?: number, color?: string, duration?: number, useVelocity?: boolean, arrowSize?: number, thickness?: number }.

Returns

  • Promise<void>

actor.showStatsBillboard

Spawns a billboarded 3D text panel floating above the actor that rotates to face the active camera in real time, automatically re-querying live GAS attributes and UProperties every tick as stats change.

Usage

// Live auto-updating stats billboard floating above actor
await marshmallow.showStatsBillboard({
  attributes: ['Health', 'ToastLevel', 'MoveSpeed'],
  properties: ['bCanBeDamaged'],
  duration: 15,
  color: 'yellow'
});

Arguments

  • optionsStatsBillboardOptions
    Configuration object: { attributes?: string[], properties?: string[], duration?: number, color?: string, offset?: Vector3 }.

Returns

  • Promise<void>

actor.updateStatsBillboard

Reconfigures the active stats billboard on the actor on the fly, updating tracked attributes, properties, or display color.

Usage

// Reconfigure stats tracked on the fly
await marshmallow.updateStatsBillboard({
  attributes: ['Health', 'ToastLevel'],
  color: 'red'
});

Arguments

  • optionsStatsBillboardOptions
    Updated billboard configuration.

Returns

  • Promise<void>

actor.clearDebugVisuals

Instantly removes all persistent debug lines, motion trails, direction arrows, and stats billboards attached to this actor.

Usage

await player.clearDebugVisuals();

Returns

  • Promise<void>

Filters & Possession

Narrow a locator to the pawns a human controls, and hand the player's controller back after possessing something else.

actor.possessed

Keeps only pawns controlled by a human player: possessed by a PlayerController, or (on a remote client) carrying a non-bot PlayerState. Pass false for the rest (AI pawns, unpossessed pawns). playerControlled() is the same filter, and filterPossessed() / filterPlayerControlled() are aliases.

Usage

// Every hero a person is playing
const humans = world.actor('BP_Hero').possessed();
await expect(humans).toHaveCount(2);

// The bots
const bots = world.actor('BP_Hero').possessed(false);

Arguments

  • possessedboolean(optional)
    Default true.

actor.locallyControlled

Keeps only the pawn this game instance's own player controls (its local PlayerController). Pass false for everyone else's. In a multiplayer test, each client's world sees a different local pawn. filterLocallyControlled() is an alias.

Usage

const me = client1.actor('BP_Hero').locallyControlled();
const others = client1.actor('BP_Hero').locallyControlled(false);

Arguments

  • locallyControlledboolean(optional)
    Default true.

actor.unpossess

After a test possessed another pawn with the player's controller, gives the controller back its original pawn, view target and camera rotation. world.restorePlayer() does the same without a locator.

Usage

await player.unpossess();

Returns

  • Promise<void>

State & Diagnostics

Existence, player state, and a full snapshot for debugging a failure.

actor.isDestroyed

True once the actor is destroyed or no longer exists in the world. To wait for it, use expect(actor).toBeDestroyed().

Usage

if (await pickup.isDestroyed()) console.log('already collected');

Returns

  • Promise<boolean>

actor.getPlayerStateInfo

The PlayerState of this pawn or controller: score, player id, name and ping. Fails for a pawn with no PlayerState (an AI minion), rather than returning another player's.

Usage

const { score, playerName } = await hero.getPlayerStateInfo();

Returns

  • Promise<{ score: number; playerId: number; playerName: string; ping: number }>

actor.getDiagnostics

A snapshot for debugging: the actor's identity, attributes, active tags and effects, and recent flight-recorder events. With an instigator, both actors and how they stand towards each other (distance, direction, facing). The GAS matchers attach this to their failure messages.

Usage

const report = await enemy.getDiagnostics({ instigator: hero, limit: 20 });
console.log(report.target?.gameplayTags, report.distance);

Arguments

  • optionsObject(optional)
    { instigator?: ActorLocator, limit?: number } recent events to include (default 30).

Returns

  • Promise<SpecterDiagnosticsReport>

Gameplay Ability System (Reads)

Read GAS state directly when a matcher doesn't fit, for example to log it or compare two actors. The matchers retry; these read once.

actor.getGrantedAbilities

Every ability granted to the actor's Ability System Component, with its class, level, input id, tags, whether it's active or can activate, and its remaining cooldown.

Usage

const abilities = await hero.getGrantedAbilities();
const dash = abilities.find(a => a.className === 'GA_Dash_C');
expect(dash?.cooldownRemaining).toBe(0);

Returns

actor.getActiveEffects

Every active Gameplay Effect on the actor: name, class, duration and time remaining, stacks, level, period, instigator, and the tags it grants.

Usage

const effects = await enemy.getActiveEffects();
console.table(effects.map(e => [e.name, e.stackCount, e.remainingTime]));

Returns

actor.hasGameplayAbility

Whether the actor was granted an ability of this class. Takes the full class path.

Usage

await hero.hasGameplayAbility('/Game/Abilities/GA_Dash.GA_Dash_C');

Arguments

  • abilityClassPathstring
    The ability's full class path.

Returns

  • Promise<boolean>

actor.isAbilityExecuting

Whether an ability is active right now, by gameplay tag (an ability carrying it) or class path.

Usage

expect(await hero.isAbilityExecuting('Ability.Slot.R')).toBe(true);

Arguments

  • abilityOrClassPathstring
    A gameplay tag or the ability's class path.

Returns

  • Promise<boolean>

actor.getAbilityCooldown

Seconds left on the ability's cooldown (its longest cooldown effect), 0 when ready. Takes the full class path.

Usage

const remaining = await hero.getAbilityCooldown('/Game/Abilities/GA_Dash.GA_Dash_C');

Arguments

  • abilityClassPathstring
    The ability's full class path.

Returns

  • Promise<number>

actor.hasGameplayEffect

Whether an effect of this class is active on the actor.

Usage

await enemy.hasGameplayEffect('/Game/Effects/GE_Burn.GE_Burn_C');

Arguments

  • effectClassPathstring
    The effect's class path.

Returns

  • Promise<boolean>

actor.getGameplayEffectStackCount

How many stacks of an active effect the actor has (0 when none).

Usage

const stacks = await enemy.getGameplayEffectStackCount('/Game/Effects/GE_Bleed.GE_Bleed_C');

Arguments

  • effectClassPathstring
    The effect's class path.

Returns

  • Promise<number>

actor.getGameplayEffectLevel

The level of an active effect on the actor.

Usage

const level = await hero.getGameplayEffectLevel('/Game/Effects/GE_Aura.GE_Aura_C');

Arguments

  • effectClassPathstring
    The effect's class path.

Returns

  • Promise<number>

actor.getAttributeBaseValue

An attribute's base value, before temporary modifiers. getAttributeValue() returns the current value.

Usage

const baseHealth = await hero.getAttributeBaseValue('HealthSet', 'MaxHealth');

Arguments

  • attributeSetstring
    The attribute set's name.
  • attributeNamestring
    The attribute's name.

Returns

  • Promise<number>

actor.getGameplayTagCount

How many times the actor carries a tag (tags stack when several effects grant them).

Usage

const stuns = await enemy.getGameplayTagCount('Status.Stunned');

Arguments

  • tagstring
    The gameplay tag.

Returns

  • Promise<number>

actor.hasAnyGameplayTags

Whether the actor has at least one of these tags.

Usage

const disabled = await enemy.hasAnyGameplayTags(['Status.Stunned', 'Status.Rooted']);

Arguments

  • tagsstring[]
    Gameplay tags.

Returns

  • Promise<boolean>

actor.hasAllGameplayTags

Whether the actor has every one of these tags.

Usage

const taunted = await enemy.hasAllGameplayTags(['Status.Taunted', 'State.BlockAbilities.Q']);

Arguments

  • tagsstring[]
    Gameplay tags.

Returns

  • Promise<boolean>

actor.pressAbilityInput

Sends an ability input press or release to the actor's Ability System Component, for abilities that wait on input inside their graph (WaitInputPress / WaitInputRelease), such as a held shield or a toggle.

Usage

await hero.triggerAbilityByTag('Ability.Slot.D');   // starts blocking
await hero.pressAbilityInput('Ability.Slot.D', false); // releases the block

Arguments

  • abilityTagstring
    The ability's gameplay tag, e.g. 'Ability.Slot.D'.
  • pressedboolean(optional)
    True to press (default), false to release.

Returns

  • Promise<void>

Character Movement

Read and wait on a Character's movement component. Each wait returns at once if the actor is already in that state, otherwise listens for the engine's movement-mode events.

actor.isFalling

Whether the character is falling right now.

Usage

const value = await hero.isFalling();

Returns

  • Promise<boolean>

actor.isFlying

Whether the character is flying right now.

Usage

const value = await hero.isFlying();

Returns

  • Promise<boolean>

actor.isSwimming

Whether the character is swimming right now.

Usage

const value = await hero.isSwimming();

Returns

  • Promise<boolean>

actor.isCrouching

Whether the character is crouching right now.

Usage

const value = await hero.isCrouching();

Returns

  • Promise<boolean>

actor.isMovingOnGround

Whether the character is on the ground (Walking or NavWalking) right now.

Usage

const value = await hero.isMovingOnGround();

Returns

  • Promise<boolean>

actor.getMovementMode

The movement mode and the state flags in one read.

Usage

const { movementMode } = await hero.getMovementMode();   // 'Walking', 'Falling', 'Flying'...

Returns

  • Promise<{ movementMode: string; isFalling: boolean; isSwimming: boolean; isFlying: boolean; isMovingOnGround: boolean; isCrouching: boolean }>

actor.waitForMovementMode

Waits until the character enters this movement mode.

Usage

await hero.waitForMovementMode('Flying', { timeout: 3000 });

Arguments

  • modestring
    'Walking', 'NavWalking', 'Falling', 'Swimming', 'Flying', 'Custom' or 'None'.
  • optionsObject(optional)
    Configuration object: { timeout?: number } (default 5000 ms).

Returns

  • Promise<void>

actor.waitForFalling

Waits until the character starts falling (a jump, a knock-up, walking off a ledge). waitForSwimming() and waitForFlying() work the same way.

Usage

await hero.pressKey('SpaceBar');
await hero.waitForFalling();

Arguments

  • optionsObject(optional)
    Configuration object: { timeout?: number } (default 5000 ms).

Returns

  • Promise<void>

actor.waitForLanded

Waits until the character lands, and returns where it hit the ground. Returns an empty object at once if it isn't falling.

Usage

const { impactPoint } = await hero.waitForLanded({ timeout: 4000 });

Arguments

  • optionsObject(optional)
    Configuration object: { timeout?: number } (default 5000 ms).

Returns

  • Promise<{ impactPoint?: Vector3; impactNormal?: Vector3 }>

actor.getMovementDirection

How the actor moves relative to a target: distances (3D and on the ground plane), speed, how well its velocity and facing line up with the target (dot products), and whether it's moving towards it, away from it, or pathfinding to it. The pursuit matchers (toBeMovingTowards, toBeFollowing...) are built on it.

Usage

const info = await turret.getMovementDirection(player);
expect(info.isFacingTarget).toBe(true);

Arguments

  • targetActorLocator | Vector3 | string
    An actor, a world location, or an actor's name.
  • optionsObject(optional)
    { minSpeed?: number (u/s), directionThreshold?: number (dot product) } for the isMoving flags.

Returns

  • Promise<{ distance; distance2D; speed; speed2D; velocityDot; facingDot; isMovingTowards; isMovingAway; isFacingTarget; isNavigatingTowards }>

Physics

Rigid bodies: push them and read their state. Each takes an optional bone name for skeletal meshes.

actor.addImpulse

Applies an impulse to the actor's root primitive (or a bone). The component must be simulating physics.

Usage

await crate.addImpulse({ x: 0, y: 0, z: 50000 });
await ragdoll.addImpulse({ x: 300, y: 0, z: 0 }, { boneName: 'spine_02', velChange: true });

Arguments

  • impulseVector3
    The impulse vector.
  • optionsObject(optional)
    { boneName?: string, velChange?: boolean } velChange treats the impulse as a velocity change, ignoring mass.

Returns

  • Promise<void>

actor.isPhysicsSimulating

Whether the actor (or a bone) is simulating physics.

Usage

expect(await crate.isPhysicsSimulating()).toBe(true);

Arguments

  • boneNamestring(optional)
    A bone, for skeletal meshes.

Returns

  • Promise<boolean>

actor.isPhysicsAsleep

Whether the rigid body has come to rest and gone to sleep.

Usage

await expect.poll(() => crate.isPhysicsAsleep(), { timeout: 5000 }).toBe(true);

Arguments

  • boneNamestring(optional)
    A bone, for skeletal meshes.

Returns

  • Promise<boolean>

actor.getPhysicsVelocity

The rigid body's linear and angular velocity, and its speed.

Usage

const { speed } = await crate.getPhysicsVelocity();

Arguments

  • boneNamestring(optional)
    A bone, for skeletal meshes.

Returns

  • Promise<{ linearVelocity: Vector3; angularVelocity: Vector3; speed: number }>

VFX & Audio

The actor's Niagara and audio components.

actor.isNiagaraActive

Whether the actor's Niagara component is active.

Usage

expect(await portal.isNiagaraActive()).toBe(true);

Returns

  • Promise<boolean>

actor.getNiagaraAsset

The name of the Niagara system on the actor's Niagara component.

Usage

const system = await portal.getNiagaraAsset();

Returns

  • Promise<string>

actor.setNiagaraVariable

Sets a user parameter on the actor's Niagara component.

Usage

await portal.setNiagaraVariable('User.SpawnRate', 200);
await portal.setNiagaraVariable('User.Color', { x: 1, y: 0.2, z: 0.2 });

Arguments

  • variableNamestring
    The parameter, e.g. 'User.SpawnRate'.
  • valuenumber | boolean | Vector3
    A float, int, bool or vector.

Returns

  • Promise<void>

actor.isAudioPlaying

Whether the actor's audio component is playing.

Usage

expect(await jukebox.isAudioPlaying()).toBe(true);

Returns

  • Promise<boolean>

actor.getSoundAsset

The name of the sound (Sound Cue or MetaSound) on the actor's audio component.

Usage

const sound = await jukebox.getSoundAsset();

Returns

  • Promise<string>

actor.getAudioVolume

The audio component's volume multiplier.

Usage

const volume = await jukebox.getAudioVolume();

Returns

  • Promise<number>

actor.playAudio

Plays the actor's audio component.

Usage

await jukebox.playAudio();

Returns

  • Promise<void>

actor.stopAudio

Stops the actor's audio component.

Usage

await jukebox.stopAudio();

Returns

  • Promise<void>

Interfaces

SpecterGrantedAbility

interface SpecterGrantedAbility {
  name: string;
  className: string;
  classPath: string;
  handle: string;
  level: number;
  inputID: number;
  isActive: boolean;
  canActivate: boolean;
  cooldownRemaining: number;   // seconds
  assetTags: string[];
  sourceTags: string[];
  allTags: string[];
  failureTags: string[];       // why it can't activate now
}

SpecterActiveEffect

interface SpecterActiveEffect {
  name: string;
  className?: string;
  classPath?: string;
  duration: number;        // seconds
  remainingTime: number;
  stackCount: number;
  level?: number;
  period?: number;
  instigator?: string;
  grantedTags?: string[];
  assetTags?: string[];
}

ControllerInfo

interface ControllerInfo {
  isPossessed: boolean;
  isPlayerControlled: boolean;
  isLocallyControlled: boolean;
  controllerClass: string;
  controllerName: string;
}

StatsBillboardOptions

interface StatsBillboardOptions {
  attributes?: string[];
  properties?: string[];
  duration?: number;
  color?: string;
  offset?: Vector3;
}

TrailOptions

interface TrailOptions {
  duration?: number;
  color?: string;
  thickness?: number;
  segmentDuration?: number;
}

Vector3

interface Vector3 {
  x: number;
  y: number;
  z: number;
}

Rotator

interface Rotator {
  pitch: number;
  yaw: number;
  roll: number;
}

Transform

interface Transform {
  location: Vector3;
  rotation?: Rotator;
  scale?: Vector3;
}

CollisionDescription

interface CollisionDescription {
  component: string;
  componentClass: string;
  actor?: string;
  profile: string;             // 'Custom' when set by hand
  collisionEnabled: 'NoCollision' | 'QueryOnly' | 'PhysicsOnly' | 'QueryAndPhysics' | 'Other';
  objectType: string;          // 'Pawn', 'WorldDynamic', a project channel
  generatesOverlapEvents: boolean;
  canEverAffectNavigation: boolean;
  responses: Record<string, 'Block' | 'Overlap' | 'Ignore'>;
}

TraceResult

interface TraceResult {
  channel: string;
  clear: boolean;              // nothing in the way (or the first thing is the target)
  from: [number, number, number];
  to: [number, number, number];
  distance: number;
  summary: string;             // 'Clear on Visibility.' or what blocked it
  blockedBy?: CollisionDescription & {
    actorClass?: string;
    location: [number, number, number];
    distance: number;
  };
}

PerceptionResult

interface PerceptionResult {
  ai: string;
  target: string;
  perceived: boolean;
  reason: string;              // 'Perceived by sight.', 'Out of range: ...', ...
  distance: number;
  angle: number;               // degrees off where it faces
  attitude: 'Friendly' | 'Neutral' | 'Hostile' | '?';
  sightRadius?: number;
  loseSightRadius?: number;
  peripheralVisionAngle?: number;
  lastSight?: { ageSeconds: number; sensed: boolean };
  trace: TraceResult;          // on the AI System's sight channel
}

OverlapResult

interface OverlapResult {
  actors: string[];
  overlaps: { component: string; actor: string; actorClass: string; otherComponent: string }[];
}