Skip to main content

Raycaster

Repeats raycasting attempts while ignoring items via a filter function.

Types

RaycastData

interface RaycastData {
PartInstance
PositionVector3
NormalVector3
MaterialEnum.Material
}

Raycast data used by filter functions of the Raycaster.

Functions

new

Raycaster.new(
doIgnoreFunction(dataRaycastData) → boolean--

Returns true to ignore

) → Raycaster

Constructs a new Raycaster.

Ignore

Raycaster.Ignore(
selfRaycaster,
tableOrInstanceInstance | {Instance}
) → ()

Ignores the value

FindPartOnRay

Raycaster.FindPartOnRay(
selfRaycaster,
rayRay
) → RaycastData?

Repeats raycasts until exhausted attempts, or a result is found.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new Raycaster.",
            "params": [
                {
                    "name": "doIgnoreFunction",
                    "desc": "Returns true to ignore",
                    "lua_type": "(data: RaycastData) -> boolean"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Raycaster\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 74,
                "path": "src/raycaster/src/Shared/Raycaster.lua"
            }
        },
        {
            "name": "Ignore",
            "desc": "Ignores the value",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Raycaster"
                },
                {
                    "name": "tableOrInstance",
                    "desc": "",
                    "lua_type": "Instance | { Instance }"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 96,
                "path": "src/raycaster/src/Shared/Raycaster.lua"
            }
        },
        {
            "name": "FindPartOnRay",
            "desc": "Repeats raycasts until exhausted attempts, or a result is found.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Raycaster"
                },
                {
                    "name": "ray",
                    "desc": "",
                    "lua_type": "Ray"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "RaycastData?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 115,
                "path": "src/raycaster/src/Shared/Raycaster.lua"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "RaycastData",
            "desc": "Raycast data used by filter functions of the Raycaster.",
            "fields": [
                {
                    "name": "Part",
                    "lua_type": "Instance",
                    "desc": ""
                },
                {
                    "name": "Position",
                    "lua_type": "Vector3",
                    "desc": ""
                },
                {
                    "name": "Normal",
                    "lua_type": "Vector3",
                    "desc": ""
                },
                {
                    "name": "Material",
                    "lua_type": "Enum.Material",
                    "desc": ""
                }
            ],
            "source": {
                "line": 22,
                "path": "src/raycaster/src/Shared/Raycaster.lua"
            }
        }
    ],
    "name": "Raycaster",
    "desc": "Repeats raycasting attempts while ignoring items via a filter function.",
    "source": {
        "line": 7,
        "path": "src/raycaster/src/Shared/Raycaster.lua"
    }
}