Table of Contents

DOLookAt Method

Namespace
DG.Tweening

DOLookAt(Rigidbody, Vector3, float, AxisConstraint, Vector3?)

public static TweenerCore<Quaternion, Vector3, QuaternionOptions> DOLookAt(this Rigidbody target, Vector3 towards, float duration, AxisConstraint axisConstraint = null, Vector3? up = null)

Tweens a Rigidbody's rotation so that it will look towards the given position. Also stores the rigidbody as the tween's target so it can be used for filtered operations

Parameters

target Rigidbody
towards Vector3

The position to look at

duration float

The duration of the tween

axisConstraint AxisConstraint

Eventual axis constraint for the rotation

up Vector3?

The vector that defines in which direction up is (default: Vector3.up)

Returns

TweenerCore<Quaternion, Vector3, QuaternionOptions>