Interface ITargetController
Interface for a character's target controller, handling targeting logic and events.
public interface ITargetController : ICharacterBehaviour
- Inherited Members
Properties
ClientSelectedTargetObjectId
SERVER-side view of the owning client's reported target frame:
the NetworkObject id the player is looking at, or 0. Advisory — feeds interest
management, never combat resolution. See TargetSelectionBroadcast.
int ClientSelectedTargetObjectId { get; }
Property Value
Current
The current target information.
TargetInfo Current { get; }
Property Value
HasClientSelectedTarget
True once any client target report has been accepted for this character. Distinguishes "the player reports no target" (authoritative 0) from "this character has no reporting client at all" (an NPC, or an old client), where readers fall back to the cast-scoped Current.
bool HasClientSelectedTarget { get; }
Property Value
OnTargetChangeTriggers
Triggers invoked when the target changes to a new target.
List<Trigger> OnTargetChangeTriggers { get; }
Property Value
OnTargetClearTriggers
Triggers invoked when the current target is cleared.
List<Trigger> OnTargetClearTriggers { get; }
Property Value
PinnedTarget
The character the owning client has pinned to its target frame, or null.
Transform PinnedTarget { get; }
Property Value
- Transform
Remarks
A pin is a HUD concept: the pinned card stays up while the pointer wanders, so the player can follow one opponent through a fight. It is never a combat target — ability acquisition stays a server-side raycast from the replicated aim — and it lives on the owning client only. On the server this is always null.
Methods
ClearPinnedTarget()
Releases the pinned target, if any.
void ClearPinnedTarget()
ServerSetClientSelectedTarget(int)
Installs a VERIFIED client target report. Server only; callers must have validated the id resolves to a live character in the reporting client's own scene (or pass 0).
void ServerSetClientSelectedTarget(int targetObjectId)
Parameters
targetObjectIdint
TogglePinnedTarget()
Pins the hovered character, or releases the pin when nothing — or the pinned character itself — is under the pointer. Owning client only.
bool TogglePinnedTarget()
Returns
- bool
True when a target is pinned after the call.
TryPinTarget(Transform)
Pins a specific character. Refused for non-characters, unspawned objects and the player's own character. Owning client only.
bool TryPinTarget(Transform target)
Parameters
targetTransformThe transform to pin.
Returns
- bool
True when the target is pinned after the call.
UpdateTarget(Vector3, Vector3, float)
Updates the target based on the given origin, direction, and max distance.
TargetInfo UpdateTarget(Vector3 origin, Vector3 direction, float maxDistance)
Parameters
originVector3directionVector3maxDistancefloat
Returns
Events
OnChangeTarget
Event triggered when the target changes.
event Action<Transform> OnChangeTarget
Event Type
- Action<Transform>
OnClearTarget
Event triggered when the target is cleared.
event Action<Transform> OnClearTarget
Event Type
- Action<Transform>
OnPinTarget
Event triggered on the owning client when a target is pinned.
event Action<Transform> OnPinTarget
Event Type
- Action<Transform>
OnUnpinTarget
Event triggered on the owning client when the pinned target is released. The argument is the released transform, or null when it was destroyed out from under the pin.
event Action<Transform> OnUnpinTarget
Event Type
- Action<Transform>
OnUpdateTarget
Event triggered when the target is updated.
event Action<Transform> OnUpdateTarget
Event Type
- Action<Transform>