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#
| VisualSpeed | Frame-based world speed of the visual object. |
|---|---|
| HasActiveSegment | True while the view is actively interpolating a movement segment. |
| SegmentSpeed | Stable 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();
Related Systems#
- MovementMotor
- VisualMoveSegment
- UnitAnimationController or your own animation scripts
