Skip to main content

FastCast

FastCast provides static utility methods for manipulating active casts (velocity, position, acceleration) and serves as the module root for constructing new Serial and Parallel casters.

Functions

newBehavior

FastCast.newBehavior() → FastCastBehavior

Creates a new FastCastBehavior, which contains information necessary to Fire the cast properly.

new

FastCast.new() → Caster

Creates a new Serial Caster. A Serial Caster runs all cast simulations on the main thread and is simpler to use but less performant than FastCast.newParallel.

newParallel

FastCast.newParallel() → Caster

Creates a new Parallel Caster. A Parallel Caster runs cast simulations on separate worker VMs

WARNING

You must initialize the Parallel Caster before using it! Failing to do so will result in nothing happening when attempting to fire!

GetVelocityCast

FastCast:GetVelocityCast(castvaildcast) → ()

Gets the velocity of an ActiveCast.

@method GetVelocityCast
@param cast vaildcast -- The active cast to get the velocity of.
@within FastCast
@return Vector3 -- The current velocity of the ActiveCast.

GetAccelerationCast

FastCast:GetAccelerationCast(castvaildcast) → ()

Gets the acceleration of an ActiveCast.

@method GetAccelerationCast
@param cast vaildcast -- The active cast to get the acceleration of.
@within FastCast
@return Vector3 -- The current acceleration of the ActiveCast.

GetPositionCast

FastCast:GetPositionCast(castvaildcast) → ()

Gets the position of an ActiveCast.

@method GetPositionCast
@param cast vaildcast -- The active cast to get the position of.
@within FastCast
@return Vector3 -- The current position of the ActiveCast.

SetVelocityCast

FastCast:SetVelocityCast(
castvaildcast,
velocityVector3
) → ()

Sets the velocity of an ActiveCast to the specified Vector3.

@method SetVelocityCast
@param cast vaildcast -- The active cast to modify.
@param velocity Vector3 -- The new velocity to set.
@within FastCast

SetAccelerationCast

FastCast:SetAccelerationCast(
castvaildcast,
accelerationVector3
) → ()

Sets the acceleration of an ActiveCast to the specified Vector3.

@method SetAccelerationCast
@param cast vaildcast -- The active cast to modify.
@param acceleration Vector3 -- The new acceleration to set.
@within FastCast

SetPositionCast

FastCast:SetPositionCast(
castvaildcast,--

The active cast to modify.

positionVector3--

The new position to set.

) → ()

Sets the position of an ActiveCast to the specified Vector3.

AddPositionCast

FastCast:AddPositionCast(
castvaildcast,
positionVector3
) → ()

Add position to an ActiveCast with the specified Vector3.

@method AddPositionCast
@param cast vaildcast -- The active cast to modify.
@param position Vector3 -- The new position to add.
@within FastCast

AddVelocityCast

FastCast:AddVelocityCast(
castvaildcast,
velocityVector3
) → ()

Add velocity to an ActiveCast with the specified Vector3.

@method AddVelocityCast
@param cast vaildcast -- The active cast to modify.
@param velocity Vector3 -- The new velocity to add.
@within FastCast

AddAccelerationCast

FastCast:AddAccelerationCast(
castvaildcast,
accelerationVector3
) → ()

Add acceleration to an ActiveCast with the specified Vector3.

@method AddAccelerationCast
@param cast vaildcast -- The active cast to modify.
@param acceleration Vector3 -- The new acceleration to add.
@within FastCast

TerminateCast

FastCast:TerminateCast(
castvaildcast,--

The active cast to terminate.

castTerminatingFunction(castvaildcast) → ())?--

Optional callback invoked just before the cast is terminated.

) → ()

Terminate function for casts

Note: If EndTime is already set, the cast is already terminated and this function returns early.

Show raw api
{
    "functions": [
        {
            "name": "newBehavior",
            "desc": "Creates a new FastCastBehavior, which contains information necessary to Fire the cast properly.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "FastCastBehavior"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 215,
                "path": "src/init.luau"
            }
        },
        {
            "name": "GetVelocityCast",
            "desc": "Gets the velocity of an ActiveCast.\n\n\t@method GetVelocityCast\n\t@param cast vaildcast -- The active cast to get the velocity of.\n\t@within FastCast\n\t@return Vector3 -- The current velocity of the ActiveCast.",
            "params": [
                {
                    "name": "cast",
                    "desc": "",
                    "lua_type": "vaildcast"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 649,
                "path": "src/init.luau"
            }
        },
        {
            "name": "GetAccelerationCast",
            "desc": "Gets the acceleration of an ActiveCast.\n\n\t@method GetAccelerationCast\n\t@param cast vaildcast -- The active cast to get the acceleration of.\n\t@within FastCast\n\t@return Vector3 -- The current acceleration of the ActiveCast.",
            "params": [
                {
                    "name": "cast",
                    "desc": "",
                    "lua_type": "vaildcast"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 668,
                "path": "src/init.luau"
            }
        },
        {
            "name": "GetPositionCast",
            "desc": "Gets the position of an ActiveCast.\n\n\t@method GetPositionCast\n\t@param cast vaildcast -- The active cast to get the position of.\n\t@within FastCast\n\t@return Vector3 -- The current position of the ActiveCast.",
            "params": [
                {
                    "name": "cast",
                    "desc": "",
                    "lua_type": "vaildcast"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 681,
                "path": "src/init.luau"
            }
        },
        {
            "name": "SetVelocityCast",
            "desc": "Sets the velocity of an ActiveCast to the specified Vector3.\n\n\t@method SetVelocityCast\n\t@param cast vaildcast -- The active cast to modify.\n\t@param velocity Vector3 -- The new velocity to set.\n\t@within FastCast",
            "params": [
                {
                    "name": "cast",
                    "desc": "",
                    "lua_type": "vaildcast"
                },
                {
                    "name": "velocity",
                    "desc": "",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 701,
                "path": "src/init.luau"
            }
        },
        {
            "name": "SetAccelerationCast",
            "desc": "Sets the acceleration of an ActiveCast to the specified Vector3.\n\n\t@method SetAccelerationCast\n\t@param cast vaildcast -- The active cast to modify.\n\t@param acceleration Vector3 -- The new acceleration to set.\n\t@within FastCast",
            "params": [
                {
                    "name": "cast",
                    "desc": "",
                    "lua_type": "vaildcast"
                },
                {
                    "name": "acceleration",
                    "desc": "",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 715,
                "path": "src/init.luau"
            }
        },
        {
            "name": "SetPositionCast",
            "desc": "Sets the position of an ActiveCast to the specified Vector3.",
            "params": [
                {
                    "name": "cast",
                    "desc": "The active cast to modify.",
                    "lua_type": "vaildcast"
                },
                {
                    "name": "position",
                    "desc": "The new position to set.",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 727,
                "path": "src/init.luau"
            }
        },
        {
            "name": "AddPositionCast",
            "desc": "Add position to an ActiveCast with the specified Vector3.\n\n\t@method AddPositionCast\n\t@param cast vaildcast -- The active cast to modify.\n\t@param position Vector3 -- The new position to add.\n\t@within FastCast",
            "params": [
                {
                    "name": "cast",
                    "desc": "",
                    "lua_type": "vaildcast"
                },
                {
                    "name": "position",
                    "desc": "",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 741,
                "path": "src/init.luau"
            }
        },
        {
            "name": "AddVelocityCast",
            "desc": "Add velocity to an ActiveCast with the specified Vector3.\n\n\t@method AddVelocityCast\n\t@param cast vaildcast -- The active cast to modify.\n\t@param velocity Vector3 -- The new velocity to add.\n\t@within FastCast",
            "params": [
                {
                    "name": "cast",
                    "desc": "",
                    "lua_type": "vaildcast"
                },
                {
                    "name": "velocity",
                    "desc": "",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 755,
                "path": "src/init.luau"
            }
        },
        {
            "name": "AddAccelerationCast",
            "desc": "Add acceleration to an ActiveCast with the specified Vector3.\n\n\t@method AddAccelerationCast\n\t@param cast vaildcast -- The active cast to modify.\n\t@param acceleration Vector3 -- The new acceleration to add.\n\t@within FastCast",
            "params": [
                {
                    "name": "cast",
                    "desc": "",
                    "lua_type": "vaildcast"
                },
                {
                    "name": "acceleration",
                    "desc": "",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 769,
                "path": "src/init.luau"
            }
        },
        {
            "name": "TerminateCast",
            "desc": "Terminate function for casts\n\nNote: If EndTime is already set, the cast is already terminated and this function returns early.",
            "params": [
                {
                    "name": "cast",
                    "desc": "The active cast to terminate.",
                    "lua_type": "vaildcast"
                },
                {
                    "name": "castTerminatingFunction",
                    "desc": "Optional callback invoked just before the cast is terminated.",
                    "lua_type": "(cast: vaildcast) -> ())?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 797,
                "path": "src/init.luau"
            }
        },
        {
            "name": "new",
            "desc": "Creates a new Serial Caster. A Serial Caster runs all cast simulations on the main thread\nand is simpler to use but less performant than [FastCast.newParallel](FastCast#newParallel).",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Caster"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 842,
                "path": "src/init.luau"
            }
        },
        {
            "name": "newParallel",
            "desc": "Creates a new Parallel Caster. A Parallel Caster runs cast simulations on separate worker VMs\n\n:::warning\nYou must [initialize](FastCastParallel#Init) the Parallel Caster before using it!\nFailing to do so will result in nothing happening when attempting to fire!\n:::",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Caster"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 869,
                "path": "src/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "FastCast",
    "desc": "FastCast provides static utility methods for manipulating active casts (velocity, position, acceleration)\nand serves as the module root for constructing new Serial and Parallel casters.",
    "source": {
        "line": 87,
        "path": "src/init.luau"
    }
}