LookRotation
7/14/25Less than 1 minute
Quaternion.LookRotation(Vector3 forward, Vector3 upwards = Vector3.up)
Creates a rotation with the specified forward and upwards directions.
Parameters:
| Name | Type | Description |
|---|---|---|
| forward | Vector3 | The direction to look in. |
| upwards | Vector3 | The vector that defines in which direction up is. |
Returns:
| type | Description |
|---|---|
| Quaternion | a 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.

