Skip to main content

FastCastParallel

FastCastParallel is the parallel caster class that runs cast simulations on separate worker VMs.

Functions

Init

FastCastParallel:Init(
numWorkersnumber,--

The number of worker VMs to create for this Caster. Must be greater than 1.

newParentFolder,--

The Folder in which to place the FastCastVMs Folder

newNamestring,--

The name to give the FastCastVMs Folder containing worker scripts.

ContainerParentFolder,--

The parent Folder in which to place the worker VM Containers.

VMContainerNameFolder,--

The name to give to the Containers housing each worker VM.

VMnamestring,--

The name to give each worker VM.

useBulkMoveToboolean,--

Whether to enable BulkMoveTo for the CosmeticBulletObjects

FastCastEventsModuleModuleScript,--

The ModuleScript containing the FastCastEvents, A table of callback functions (events/hooks) used by ActiveCast..

useObjectCacheboolean,--

Whether to use ObjectCache for the Caster

TemplateBasePart | Model,--

The template object to use for the ObjectCache (if enabled)

CacheSizenumber,--

The size of the ObjectCache (if enabled)

CacheHolderInstance--

The Instance in which to place cached objects (if enabled)

) → ()

Initializes the Caster with the given parameters. This is required before firing using Raycasts in the Caster or nothing will happen!

SetFastCastEventsModule

FastCastParallel:SetFastCastEventsModule(
moduleScriptModuleScript--

The FastCastEventsModule to set.

) → ()

Set the FastCastEventsModule for all BaseCasts created from this Caster.

RaycastFire

FastCastParallel:RaycastFire(
originVector3,--

The origin of the raycast.

directionVector3,--

The direction of the raycast.

velocityVector3 | number,--

The velocity of the raycast.

BehaviorDataFastCastBehavior?--

The behavior data for the raycast.

) → ()

Raycasts the Caster with the specified parameters.

BlockcastFire

FastCastParallel:BlockcastFire(
originVector3,--

The origin of the blockcast.

SizeVector3,--

The size of the blockcast.

directionVector3,--

The direction of the blockcast.

velocityVector3 | number,--

The velocity of the blockcast.

BehaviorDataFastCastBehavior?--

The behavior data for the blockcast.

) → ()

Blockcasts the Caster with the specified parameters.

SpherecastFire

FastCastParallel:SpherecastFire(
originVector3,--

The origin of the spherecast.

Radiusnumber,--

The radius of the spherecast.

directionVector3,--

The direction of the spherecast.

velocityVector3 | number,--

The velocity of the spherecast.

BehaviorDataFastCastBehavior?--

The behavior data for the spherecast.

) → ()

Spherecasts the Caster with the specified parameters.

SetMovementModeEnabled

FastCastParallel:SetMovementModeEnabled(
enabledboolean,--

Is enabled

mode"BulkMoveTo" | "Motor6D"--

The movement mode to set for casts.

) → ()

Sets the movement mode for casts.

SetObjectCacheEnabled

FastCastParallel:SetObjectCacheEnabled(enabledboolean) → ()

Sets whether ObjectCache is enabled for this Caster. It is recommended to interface with this via FastCastParallel:Init() instead.

Destroy

FastCastParallel:Destroy() → ()

Destroy's a Caster, cleaning up all resources used by it.

SyncChangesToCast

FastCastParallel:SyncChangesToCast(castvaildcast) → ()

Synchronize new changes to the ActiveCast.

@method SyncChangesToCast
@param cast vaildcast -- The active cast to synchronize.
@within FastCastParallel
Show raw api
{
    "functions": [
        {
            "name": "Init",
            "desc": "Initializes the Caster with the given parameters. This is required before firing using Raycasts in the Caster or nothing will happen!",
            "params": [
                {
                    "name": "numWorkers",
                    "desc": "The number of worker VMs to create for this Caster. Must be greater than 1.",
                    "lua_type": "number"
                },
                {
                    "name": "newParent",
                    "desc": "The Folder in which to place the FastCastVMs Folder",
                    "lua_type": "Folder"
                },
                {
                    "name": "newName",
                    "desc": "The name to give the FastCastVMs Folder containing worker scripts.",
                    "lua_type": "string"
                },
                {
                    "name": "ContainerParent",
                    "desc": "The parent Folder in which to place the worker VM Containers.",
                    "lua_type": "Folder"
                },
                {
                    "name": "VMContainerName",
                    "desc": "The name to give to the Containers housing each worker VM.",
                    "lua_type": "Folder"
                },
                {
                    "name": "VMname",
                    "desc": "The name to give each worker VM.",
                    "lua_type": "string"
                },
                {
                    "name": "useBulkMoveTo",
                    "desc": "Whether to enable BulkMoveTo for the [CosmeticBulletObjects](TypeDefinitions#CastRayInfo)",
                    "lua_type": "boolean"
                },
                {
                    "name": "FastCastEventsModule",
                    "desc": "The ModuleScript containing the FastCastEvents, A table of callback functions (events/hooks) used by ActiveCast..",
                    "lua_type": "ModuleScript"
                },
                {
                    "name": "useObjectCache",
                    "desc": "Whether to use ObjectCache for the [Caster](TypeDefinitions#Caster)",
                    "lua_type": "boolean"
                },
                {
                    "name": "Template",
                    "desc": "The template object to use for the ObjectCache (if enabled)",
                    "lua_type": "BasePart | Model"
                },
                {
                    "name": "CacheSize",
                    "desc": "The size of the ObjectCache (if enabled)",
                    "lua_type": "number"
                },
                {
                    "name": "CacheHolder",
                    "desc": "The Instance in which to place cached objects (if enabled)",
                    "lua_type": "Instance"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 237,
                "path": "src/init.luau"
            }
        },
        {
            "name": "SetFastCastEventsModule",
            "desc": "Set the FastCastEventsModule for all BaseCasts created from this Caster.",
            "params": [
                {
                    "name": "moduleScript",
                    "desc": "The FastCastEventsModule to set.",
                    "lua_type": "ModuleScript"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 306,
                "path": "src/init.luau"
            }
        },
        {
            "name": "RaycastFire",
            "desc": "Raycasts the Caster with the specified parameters.",
            "params": [
                {
                    "name": "origin",
                    "desc": "The origin of the raycast.",
                    "lua_type": "Vector3"
                },
                {
                    "name": "direction",
                    "desc": "The direction of the raycast.",
                    "lua_type": "Vector3"
                },
                {
                    "name": "velocity",
                    "desc": "The velocity of the raycast.",
                    "lua_type": "Vector3 | number"
                },
                {
                    "name": "BehaviorData",
                    "desc": "The behavior data for the raycast.",
                    "lua_type": "FastCastBehavior?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 325,
                "path": "src/init.luau"
            }
        },
        {
            "name": "BlockcastFire",
            "desc": "Blockcasts the Caster with the specified parameters.",
            "params": [
                {
                    "name": "origin",
                    "desc": "The origin of the blockcast.",
                    "lua_type": "Vector3"
                },
                {
                    "name": "Size",
                    "desc": "The size of the blockcast.",
                    "lua_type": "Vector3"
                },
                {
                    "name": "direction",
                    "desc": "The direction of the blockcast.",
                    "lua_type": "Vector3"
                },
                {
                    "name": "velocity",
                    "desc": "The velocity of the blockcast.",
                    "lua_type": "Vector3 | number"
                },
                {
                    "name": "BehaviorData",
                    "desc": "The behavior data for the blockcast.",
                    "lua_type": "FastCastBehavior?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 352,
                "path": "src/init.luau"
            }
        },
        {
            "name": "SpherecastFire",
            "desc": "Spherecasts the Caster with the specified parameters.",
            "params": [
                {
                    "name": "origin",
                    "desc": "The origin of the spherecast.",
                    "lua_type": "Vector3"
                },
                {
                    "name": "Radius",
                    "desc": "The radius of the spherecast.",
                    "lua_type": "number"
                },
                {
                    "name": "direction",
                    "desc": "The direction of the spherecast.",
                    "lua_type": "Vector3"
                },
                {
                    "name": "velocity",
                    "desc": "The velocity of the spherecast.",
                    "lua_type": "Vector3 | number"
                },
                {
                    "name": "BehaviorData",
                    "desc": "The behavior data for the spherecast.",
                    "lua_type": "FastCastBehavior?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 380,
                "path": "src/init.luau"
            }
        },
        {
            "name": "SetMovementModeEnabled",
            "desc": "Sets the movement mode for casts.",
            "params": [
                {
                    "name": "enabled",
                    "desc": "Is enabled",
                    "lua_type": "boolean"
                },
                {
                    "name": "mode",
                    "desc": "The movement mode to set for casts.",
                    "lua_type": "\"BulkMoveTo\" | \"Motor6D\""
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 405,
                "path": "src/init.luau"
            }
        },
        {
            "name": "SetObjectCacheEnabled",
            "desc": "Sets whether ObjectCache is enabled for this Caster.\nIt is recommended to interface with this via [`FastCastParallel:Init()`](FastCastParallel#Init) instead.",
            "params": [
                {
                    "name": "enabled",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 423,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Destroy",
            "desc": "Destroy's a Caster, cleaning up all resources used by it.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 620,
                "path": "src/init.luau"
            }
        },
        {
            "name": "SyncChangesToCast",
            "desc": "Synchronize new changes to the ActiveCast.\n\n\t@method SyncChangesToCast\n\t@param cast vaildcast -- The active cast to synchronize.\n\t@within FastCastParallel",
            "params": [
                {
                    "name": "cast",
                    "desc": "",
                    "lua_type": "vaildcast"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 782,
                "path": "src/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "FastCastParallel",
    "desc": "FastCastParallel is the parallel caster class that runs cast simulations on separate worker VMs.",
    "source": {
        "line": 110,
        "path": "src/init.luau"
    }
}