Skip to content

Api > Quaternion > FromToRotation()


Quaternion.FromToRotation(Vector3 fromDirection, Vector3 toDirection)⚓︎

Creates a rotation which rotates from fromDirection to toDirection.

Parameters:⚓︎

Name Type Description
fromDirection Vector3 from Direction
toDirection Vector3 to Direction

Returns:⚓︎

type Description
Quaternion rotation which rotates from fromDirection to toDirection.

Usage⚓︎

---@type Vector3
local fromDirection;

---@type Vector3
local toDirection;


local val0 = Quaternion:FromToRotation(fromDirection, toDirection)