Skip to main content

RaycastUtil

Gives some nice methods for raycasting.

Functions

RaycastMouse

RaycastUtil:RaycastMouse(
distancenumber,
raycastParamsRaycastParams | nil,
checkAllCollisionGroupsboolean | nil
) → ()

Sends a raycast from our camera to the point our mouse is at in the world.

checkAllCollisionGroups=true will make sure we raycast against parts that don't collide with the "Default" Collision Group (see the ".Locked" macro)

Raycast

RaycastUtil:Raycast(
originVector3,
directionVector3,
distancenumber,
raycastParamsRaycastParams | nil,
checkAllCollisionGroupsboolean | nil
) → ()

Does a bog standard raycast.

checkAllCollisionGroups=true will make sure we raycast against parts that don't collide with the "Default" Collision Group (see the ".Locked" macro)

Show raw api
{
    "functions": [
        {
            "name": "RaycastMouse",
            "desc": "Sends a raycast from our camera to the point our mouse is at in the world.\n\n`checkAllCollisionGroups=true` will make sure we raycast against parts that don't collide with the `\"Default\"` Collision Group (see the \".Locked\" macro)",
            "params": [
                {
                    "name": "distance",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "raycastParams",
                    "desc": "",
                    "lua_type": "RaycastParams|nil"
                },
                {
                    "name": "checkAllCollisionGroups",
                    "desc": "",
                    "lua_type": "boolean|nil"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 78,
                "path": "docs_api/utils.lua"
            }
        },
        {
            "name": "Raycast",
            "desc": "Does a bog standard raycast.\n\n`checkAllCollisionGroups=true` will make sure we raycast against parts that don't collide with the `\"Default\"` Collision Group (see the \".Locked\" macro)",
            "params": [
                {
                    "name": "origin",
                    "desc": "",
                    "lua_type": "Vector3"
                },
                {
                    "name": "direction",
                    "desc": "",
                    "lua_type": "Vector3"
                },
                {
                    "name": "distance",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "raycastParams",
                    "desc": "",
                    "lua_type": "RaycastParams|nil"
                },
                {
                    "name": "checkAllCollisionGroups",
                    "desc": "",
                    "lua_type": "boolean|nil"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 92,
                "path": "docs_api/utils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "RaycastUtil",
    "desc": "Gives some nice methods for raycasting. ",
    "source": {
        "line": 66,
        "path": "docs_api/utils.lua"
    }
}