Skip to content

Sein Targeter Subsystem

Class · USeinTargeterSubsystem : ULocalPlayerSubsystem

#include "Player/SeinTargeterSubsystem.h"

Runs target selection for abilities that need the player to pick a point or area. Activate starts a session for an ability; the player’s primary click captures a point and the command click cancels. When enough points are captured, the ability is ordered and the targeter returns to Idle. One exists per local player.

Activate the targeter for a given ability + owner entity.

  • Spec: drives capture flow + preview class. Required.

  • AbilityTag: stamped into the submitted command’s PredeterminedAbilityTag.

  • OwnerLeader: entity whose ability is being targeted (for range / LOS hints).

  • AreaRadiusWorld: copied from USeinAbility::AreaRadius converted to world units. Cancels any prior targeter session.

void Activate(USeinTargeterSpec* InSpec, FGameplayTag InAbilityTag, FSeinEntityHandle InOwnerLeader, float InAreaRadiusWorld);

Cancel without submitting. Despawns preview, resets state to Idle.

void Cancel();

Returns the current drag-anchor world position when the state is Dragging, otherwise zero vector. The preview reads this each tick to lock its position while rotating with the cursor.

FVector GetDragAnchor() const;

Returns the snapped yaw rotation (degrees) the spec is currently reporting. Only meaningful while Dragging; zero otherwise.

float GetSnappedYawDegrees() const;

The targeter’s current state: Idle, Waiting For Capture, or Dragging.

ESeinTargeterState GetState() const;

True while a targeting session is in progress, meaning the state is not Idle.

bool IsActive() const;

Number of points captured so far in the current session. UI can show e.g. “2 / 3 grenades placed” for multi-target abilities.

int32 GetCapturedCount() const;

FSeinOnTargeterStateChanged OnStateChanged · passes ESeinTargeterState NewState

Fires when the targeter starts, changes phase or returns to Idle, with the new state. Use it to change the cursor or highlight the action slot.

C++ members (5)
  • void ReleaseModuleOwnedStateForModuleUnload(); Destroy transient targeting state before module withdrawal.
  • void OnConfirmPressed(); PC input forwarding: confirm-input driven by the player’s Select action (LMB by default; the Blueprint wiring owns the binding). When a targeter is active, the PC routes its Select events here instead of running selection.
  • void OnConfirmReleased();
  • void OnCancelInput(); PC input forwarding: cancel-input driven by the player’s Command action (RMB by default). Cancels the active targeter. The PC routes Command presses here only while the targeter is active; otherwise commands issue normally. Also invoked by the PC’s select-cancel path when a confirm press’s input evaluation is canceled — a canceled confirm must never place a target.
  • void UpdateCursor(const FVector& CursorWorld); Per-frame cursor update. Called by ASeinPlayerController::Tick when the targeter is active. Drives preview transform + tri-state validity.