• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    Quaternion

    A Quaternion represents rotation and direction in 3D space, consisting of x, y, z, and w components. They are crucial for 3D movement and rotation, offering advantages such as avoiding gimbal lock. Unity's Quaternion Documentation

    Properties

    eulerAngles

    ClientAndServer

    Returns the rotation of a Quaternion in Euler angles representation. Unity's Quaternion.eulerAngles Documentation

    identity

    ClientAndServer
    ReadOnly

    Represents a Quaternion for no rotation. Unity's Quaternion.identity Documentation

    normalized

    ClientAndServer
    ReadOnly

    Returns a normalized copy of the Quaternion. Useful for ensuring the Quaternion has a magnitude of 1. Unity's Quaternion.normalized Documentation

    w

    number
    ClientAndServer

    Represents the w (scalar) component of the Quaternion. Unity's Quaternion.w Documentation

    x

    number
    ClientAndServer

    Represents the x component of the Quaternion. Unity's Quaternion.x Documentation

    y

    number
    ClientAndServer

    Represents the y component of the Quaternion. Unity's Quaternion.y Documentation

    z

    number
    ClientAndServer

    Represents the z component of the Quaternion. Unity's Quaternion.z Documentation

    Methods

    Angle

    ClientAndServer

    Returns the angle in degrees between two rotations. Unity's Quaternion.Angle Documentation

    Parameters

    The first rotation.

    The second rotation.

    Returns

    number

    The angle in degrees between the two rotations.

    AngleAxis

    ClientAndServer

    Creates a Quaternion rotation around an axis by a specified angle. Unity's Quaternion.AngleAxis Documentation

    Parameters

    angle
    number

    The angle of rotation.

    The rotation axis.

    Returns

    A Quaternion around the specified axis with the given angle.

    Dot

    ClientAndServer

    Calculates the dot product of two quaternions. Unity's Quaternion.Dot Documentation

    Parameters

    The first quaternion.

    The second quaternion.

    Returns

    number

    The dot product of the two quaternions.

    Equals

    ClientAndServer

    Checks if two Quaternions are equal. Unity's Quaternion.Equals Documentation

    Parameters

    The Quaternion to compare with.

    Returns

    boolean

    Returns true if the Quaternions are equal.

    Euler

    ClientAndServer

    Creates a Quaternion rotation from Euler angles. Unity's Quaternion.Euler Documentation

    Parameters

    euler

    Returns

    A Quaternion from the Euler angles.

    Euler

    ClientAndServer

    Creates a Quaternion rotation from Euler angles. Unity's Quaternion.Euler Documentation

    Parameters

    x
    number

    The angle around the x-axis in degrees.

    y
    number

    The angle around the y-axis in degrees.

    z
    number

    The angle around the z-axis in degrees.

    Returns

    A Quaternion from the Euler angles.

    FromToRotation

    ClientAndServer

    Creates a Quaternion that rotates from one direction to another. Unity's Quaternion.FromToRotation Documentation

    Parameters

    fromDirection

    The vector to rotate from.

    toDirection

    The vector to rotate to.

    Returns

    A rotation from fromDirection to toDirection.

    Inverse

    ClientAndServer

    Returns the inverse of the Quaternion. Unity's Quaternion.Inverse Documentation

    Parameters

    rotation

    The rotation to inverse.

    Returns

    The inverse rotation.

    Lerp

    ClientAndServer

    Linearly interpolates between two quaternions. Unity's Quaternion.Lerp Documentation

    Parameters

    The starting rotation.

    The end rotation.

    t
    number

    The amount to interpolate.

    Returns

    An interpolated quaternion rotation.

    LerpUnclamped

    ClientAndServer

    The 'LerpUnclamped' method is similar to Lerp, but here the interpolation factor isn't clamped to the range [0, 1]. Unity's Quaternion.LerpUnclamped Documentation

    Parameters

    The starting rotation.

    The end rotation.

    t
    number

    The unclamped interpolation amount.

    Returns

    Returns a Quaternion that is interpolated over an arbitrary range.

    LookRotation

    ClientAndServer

    Provides a quaternion that makes an object face towards a specified direction. Unity's Quaternion.LookRotation Documentation

    Parameters

    forward

    The direction to be faced.

    Returns

    A Quaternion that aligns an object's forward direction towards the specified direction.

    LookRotation

    ClientAndServer

    Provides a quaternion that makes an object face towards a specified direction. Unity's Quaternion.LookRotation Documentation

    Parameters

    forward

    The direction to be faced.

    upwards

    The direction to be used as 'upwards'.

    Returns

    A Quaternion that aligns an object's forward direction towards the specified direction.

    Multiply

    ClientAndServer

    Multiplies two Quaternions together. Unity's Quaternion.Multiply Documentation

    Parameters

    The first Quaternion.

    The second Quaternion.

    Returns

    The product of the two Quaternions.

    Normalize

    ClientAndServer

    Modifies the quaternion to a unit length version of itself. Unity's Quaternion.Normalize Documentation

    Parameters

    The Quaternion to be normalized.

    Returns

    The normalized version of the quaternion.

    Normalize

    ClientAndServer

    Modifies the quaternion to a unit length version of itself. Unity's Quaternion.Normalize Documentation

    Returns

    void

    RotateTowards

    ClientAndServer

    Gradually changes a Quaternion towards a target rotation. Unity's Quaternion.RotateTowards Documentation

    Parameters

    The current rotation.

    The target rotation.

    maxDegreesDelta
    number

    The maximum number of degrees to rotate by in each call.

    Returns

    A Quaternion rotated towards the target.

    Set

    ClientAndServer

    Assigns new values to the Quaternion's components. Unity's Quaternion.Set Documentation

    Parameters

    newX
    number

    The new x component.

    newY
    number

    The new y component.

    newZ
    number

    The new z component.

    newW
    number

    The new w component.

    Returns

    void

    SetFromToRotation

    ClientAndServer

    Sets the Quaternion to rotate from one direction to another. Unity's Quaternion.SetFromToRotation Documentation

    Parameters

    fromDirection

    The vector to rotate from.

    toDirection

    The vector to rotate to.

    Returns

    void

    SetLookRotation

    ClientAndServer

    Aligns the Quaternion's z-axis towards a target direction. Unity's Quaternion.SetLookRotation Documentation

    Parameters

    The target direction vector.

    Returns

    void

    SetLookRotation

    ClientAndServer

    Aligns the Quaternion's z-axis towards a target direction. Unity's Quaternion.SetLookRotation Documentation

    Parameters

    The target direction vector.

    Returns

    void

    Slerp

    ClientAndServer

    Gradually changes a Quaternion from one rotation to another. Unity's Quaternion.Slerp Documentation

    Parameters

    The starting rotation.

    The end rotation.

    t
    number

    The amount to interpolate.

    Returns

    An interpolated quaternion rotation.

    SlerpUnclamped

    ClientAndServer

    Interpolates a Quaternion over an arbitrary range. Unity's Quaternion.SlerpUnclamped Documentation

    Parameters

    The starting rotation.

    The end rotation.

    t
    number

    The unclamped interpolation amount.

    Returns

    An interpolated quaternion rotation.

    Updated 9 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.