Script Reference

UnitViewMotor.cs

Presentation-only component that consumes VisualMoveSegments to smoothly interpolate and rotate a unit model.

PresentationMovementAnimation

Overview

UnitViewMotor makes movement look smooth while MovementMotor remains authoritative. It consumes queued VisualMoveSegments and interpolates the transform between tile centers.

This component is safe for animation and visual polish. It should not be treated as the source of gameplay position.

Inspector Settings

Movement Motor

Reference to the MovementMotor that owns authoritative movement.

Snap To Authoritative Position On Start

Starts the visual object at the motor's current grounded world position.

Rotate Toward Movement

Rotates the visual toward its movement direction.

Rotation Smooth Time

Controls how smoothly the model turns toward movement direction.

Movement Start Delay

Adds a small delay before visual movement begins after idle.

Public API

FaceToward(Vector3 worldPosition)

Immediately turns the unit to face a world position.

SnapImmediatelyToAuthoritativePosition()

Clears visual playback and snaps the object to the MovementMotor's current authoritative position.

Runtime Properties

VisualSpeedFrame-based world speed of the visual object.
HasActiveSegmentTrue while the view is actively interpolating a movement segment.
SegmentSpeedStable speed based on the active segment's distance and duration.

Common Usage

// Useful before interaction, combat, or dialogue.
unitViewMotor.FaceToward(targetWorldPosition);

// Useful after teleporting or correcting position.
unitViewMotor.SnapImmediatelyToAuthoritativePosition();