Skip to main content

Quaternion.FromToRotation(Vector3 fromDirection, Vector3 toDirection)

Creates a rotation which rotates from fromDirection to toDirection.

Parameters:

NameTypeDescription
fromDirectionVector3from Direction
toDirectionVector3to Direction

Returns:

typeDescription
Quaternionrotation which rotates from fromDirection to toDirection.

Usage

---@type Vector3
local fromDirection;

---@type Vector3
local toDirection;


local val0 = Quaternion:FromToRotation(fromDirection, toDirection)