Skip to content

Api > Quaternion > SetFromToRotation()


Quaternion.SetFromToRotation(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

Usage⚓︎

---@type Quaternion
local quaternion;

---@type Vector3
local fromDirection;

---@type Vector3
local toDirection;


quaternion.SetFromToRotation(fromDirection, toDirection)