Skip to main content

ClientCaster

An object which handles raycasting and client-communication.

Properties

RaycastParams

This item is read only and cannot be modified. Read Only
ClientCaster.RaycastParams: RaycastParams

Returns the ClientCaster's set RaycastParams.

Debug

This item is read only and cannot be modified. Read Only
ClientCaster.Debug: boolean

Returns whether the ClientCaster object has debug mode enabled, visualizing the ClientCaster's rays.

Recursive

This item is read only and cannot be modified. Read Only
ClientCaster.Recursive: boolean

Determines whether the Caster object will search for Raycast points (DmgPoints) from the whole object's descendants, rather then the object's direct children.

Object

This item is read only and cannot be modified. Read Only
ClientCaster.Object: Instance

Returns the object that the ClientCaster is raycasting from.

Owner

This item is read only and cannot be modified. Read Only
ClientCaster.Owner: Player?

Returns the current Player who is the owner of the caster, or nil in case of the server. The owner calculates intersections, and as such it's recommended to have the client calculate it to have less of a burden on the server.

Disabled

This item is read only and cannot be modified. Read Only
ClientCaster.Disabled: boolean

Returns whether the ClientCaster is disabled (not raycasting).

Collided

Events
ClientCaster.Collided: Signal<RaycastResult>

Fires whenever any object intersects any one of the ClientCaster's rays.

HumanoidCollided

Events
ClientCaster.HumanoidCollided: Signal<RaycastResult,Humanoid>

Fires whenever any of the ClientCaster's rays intersect with an object, whose ancestor Model has a Humanoid object.

Functions

DisableDebug

ClientCaster:DisableDebug() → ()

Disables the debug trails of the ClientCaster.

StartDebug

ClientCaster:StartDebug() → ()

Starts the debug trails of the ClientCaster.

Start

ClientCaster:Start() → ()

Starts this ClientCaster object, beginning to raycast for the hit detection.

Destroy

ClientCaster:Destroy() → ()

Destroys this ClientCaster object, cleaning up any remnant connections.

Stop

ClientCaster:Stop() → ()

Stops this ClientCaster object, stopping raycasts for hit detection.

SetOwner

ClientCaster:SetOwner(NewOwnerPlayer) → ()

Sets the given Player as owner for this caster object. When NewOwner is nil, the server will be the owner instead of a Player.

GetOwner

ClientCaster:GetOwner() → Player?

Returns the current Player who is the owner of the caster, or nil in case of the server. The owner calculates intersections, and as such it's recommended to have the client calculate it to have less of a burden on the server.

SetObject

ClientCaster:SetObject(ObjectInstance) → ()

Sets this ClientCaster's object which it will raycast from to Object.

GetObject

ClientCaster:GetObject() → Instance

Returns the object this ClientCaster is raycasting from.

EditRaycastParams

ClientCaster:EditRaycastParams(RaycastParametersRaycastParams) → ()

Updates the ClientCaster's RaycastParams property.

SetRecursive

ClientCaster:SetRecursive(Recursiveboolean) → ()

when set to true, the ClientCaster object will search for Raycast points (DmgPoints) from the whole Object's descendants, rather then the Object's direct children. Useful for whole model hitboxes and characters.

Show raw api
{
    "functions": [
        {
            "name": "DisableDebug",
            "desc": "Disables the debug trails of the ClientCaster.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 286,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "StartDebug",
            "desc": "Starts the debug trails of the ClientCaster.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 303,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "Start",
            "desc": "Starts this ClientCaster object, beginning to raycast for the hit detection.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 326,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "Destroy",
            "desc": "Destroys this ClientCaster object, cleaning up any remnant connections.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 342,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "Stop",
            "desc": "Stops this ClientCaster object, stopping raycasts for hit detection.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 378,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "SetOwner",
            "desc": "Sets the given Player as owner for this caster object. When NewOwner is nil, the server will be the owner instead of a Player.",
            "params": [
                {
                    "name": "NewOwner",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 395,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "GetOwner",
            "desc": "Returns the current Player who is the owner of the caster, or nil in case of the server. The owner calculates intersections, and\nas such it's recommended to have the client calculate it to have less of a burden on the server.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Player?"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 417,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "SetObject",
            "desc": "Sets this ClientCaster's object which it will raycast from to Object.",
            "params": [
                {
                    "name": "Object",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 424,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "GetObject",
            "desc": "Returns the object this ClientCaster is raycasting from.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 457,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "EditRaycastParams",
            "desc": "Updates the ClientCaster's RaycastParams property.",
            "params": [
                {
                    "name": "RaycastParameters",
                    "desc": "",
                    "lua_type": "RaycastParams"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 464,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "SetRecursive",
            "desc": "when set to true, the ClientCaster object will search for Raycast points (DmgPoints) from the whole Object's descendants, rather then the Object's direct children.\nUseful for whole model hitboxes and characters.",
            "params": [
                {
                    "name": "Recursive",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 478,
                "path": "lib/init.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "RaycastParams",
            "desc": "Returns the ClientCaster's set RaycastParams.",
            "lua_type": "RaycastParams",
            "readonly": true,
            "source": {
                "line": 238,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "Debug",
            "desc": "Returns whether the ClientCaster object has debug mode enabled, visualizing the ClientCaster's rays.",
            "lua_type": "boolean",
            "readonly": true,
            "source": {
                "line": 243,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "Recursive",
            "desc": "Determines whether the Caster object will search for Raycast points (DmgPoints) from the whole object's descendants, rather then the object's direct children.",
            "lua_type": "boolean",
            "readonly": true,
            "source": {
                "line": 248,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "Object",
            "desc": "Returns the object that the ClientCaster is raycasting from.",
            "lua_type": "Instance",
            "readonly": true,
            "source": {
                "line": 253,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "Owner",
            "desc": "Returns the current Player who is the owner of the caster, or nil in case of the server. The owner calculates intersections, and as such it's recommended to have the client calculate it to have less of a burden on the server.",
            "lua_type": "Player?",
            "readonly": true,
            "source": {
                "line": 258,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "Disabled",
            "desc": "Returns whether the ClientCaster is disabled (not raycasting).",
            "lua_type": "boolean",
            "readonly": true,
            "source": {
                "line": 263,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "Collided",
            "desc": "Fires whenever any object intersects any one of the ClientCaster's rays.",
            "lua_type": "Signal<RaycastResult>",
            "tags": [
                "Events"
            ],
            "source": {
                "line": 268,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "HumanoidCollided",
            "desc": "Fires whenever any of the ClientCaster's rays intersect with an object, whose ancestor Model has a Humanoid object.",
            "lua_type": "Signal<RaycastResult, Humanoid>",
            "tags": [
                "Events"
            ],
            "source": {
                "line": 273,
                "path": "lib/init.luau"
            }
        }
    ],
    "types": [],
    "name": "ClientCaster",
    "desc": "An object which handles raycasting and client-communication.",
    "source": {
        "line": 233,
        "path": "lib/init.luau"
    }
}