LookAtAction

Agent action that instantly rotates and orients the character to face a target item. Uses the character's controller to set both body rotation and look-at direction in a single frame.

Definition

Namespace: Paragon.Townskeep.AgentSystem Assembly: Townskeep.dll

public class LookAtAction : AgentAction

Inheritance: ActionAgentAction → LookAtAction

Remarks

LookAtAction is a synchronous, single-frame action that snaps the character's orientation toward a target item. It is typically used before GrabItemAction in a sequence so the character faces the item before picking it up.

Execution Flow

spinner

Two-Step Orientation

The action performs two distinct controller operations:

  1. RotateTo — rotates the character's body to face the target position (yaw rotation)

  2. LookAt — sets the character's head/eye look-at target (for IK or camera)

Both operations use the item's transform.position as the target point.

Quick Lookup

Goal
How

Face the character toward an item

Add LookAtAction to sequence; ensure "Item" variable is set

Combine with grab

Place LookAtAction before GrabItemAction in the sequence

Fields

Field
Type
Access
Description

item

Item

[Variable] private

The target item to look at; bound from sequence variables

Methods

OnExecute

Rotates the character body toward the item and sets the look-at target. Returns synchronously.

Returns: Task.CompletedTask — this action completes instantly.

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation

See Also

Last updated