Skip to main content

Quaternion.LookRotation(Vector3 forward, Vector3 upwards = Vector3.up)

Creates a rotation with the specified forward and upwards directions.

Parameters:

NameTypeDescription
forwardVector3The direction to look in.
upwardsVector3The vector that defines in which direction up is.

Returns:

typeDescription
Quaterniona rotation with the specified forward and upwards directions.

Usage

---@type Vector3
local forward;

---@type Vector3
local upwards ;


local val0 = Quaternion:LookRotation(forward, upwards )

Extra Detail

Z axis will be aligned with forward, X axis aligned with cross product between forward and upwards, and Y axis aligned with cross product between Z and X.