Skip to main content

getRotationInXZPlane

Utility function to get rotation in the XZ plane.

Functions

getRotationInXZPlane

getRotationInXZPlane.getRotationInXZPlane(cframeCFrame) → CFrame--

The CFrame in the XZ plane

Computes the rotation in the XZ plane relative to the origin.

tip

This function can be used to "flatten" a rotation so we just get the XZ rotation, which is the rotation you would see if we are looking directly top-down on the object.

Show raw api
{
    "functions": [
        {
            "name": "getRotationInXZPlane",
            "desc": "Computes the rotation in the XZ plane relative to the origin.\n\n:::tip\nThis function can be used to \"flatten\" a rotation so we just get the XZ rotation, which\nis the rotation you would see if we are looking directly top-down on the object.\n:::",
            "params": [
                {
                    "name": "cframe",
                    "desc": "",
                    "lua_type": "CFrame"
                }
            ],
            "returns": [
                {
                    "desc": "The CFrame in the XZ plane",
                    "lua_type": "CFrame"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 18,
                "path": "src/cframeutils/src/Shared/getRotationInXZPlane.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "getRotationInXZPlane",
    "desc": "Utility function to get rotation in the XZ plane.",
    "source": {
        "line": 5,
        "path": "src/cframeutils/src/Shared/getRotationInXZPlane.lua"
    }
}