Skip to main content

FastCastParallel

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

Functions​

Init​

FastCastParallel:Init(
numWorkers: number,--

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

newParent: Folder,--

The Folder in which to place the FastCastVMs Folder

newName: string,--

The name to give the FastCastVMs Folder containing worker scripts.

ContainerParent: Folder,--

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

VMContainerName: Folder,--

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

VMname: string,--

The name to give each worker VM.

useBulkMoveTo: boolean,--

Whether to enable BulkMoveTo for the CosmeticBulletObjects

FastCastEventsModule: ModuleScript,--

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

useObjectCache: boolean,--

Whether to use ObjectCache for the Caster

Template: BasePart | Model,--

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

CacheSize: number,--

The size of the ObjectCache (if enabled)

CacheHolder: Instance--

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(
moduleScript: ModuleScript--

The FastCastEventsModule to set.

) → ()

Set the FastCastEventsModule for all BaseCasts created from this Caster.

RaycastFire​

FastCastParallel:RaycastFire(
origin: Vector3,--

The origin of the raycast.

direction: Vector3,--

The direction of the raycast.

velocity: Vector3 | number,--

The velocity of the raycast.

BehaviorData: FastCastBehavior?--

The behavior data for the raycast.

) → ()

Raycasts the Caster with the specified parameters.

BlockcastFire​

FastCastParallel:BlockcastFire(
origin: Vector3,--

The origin of the blockcast.

Size: Vector3,--

The size of the blockcast.

direction: Vector3,--

The direction of the blockcast.

velocity: Vector3 | number,--

The velocity of the blockcast.

BehaviorData: FastCastBehavior?--

The behavior data for the blockcast.

) → ()

Blockcasts the Caster with the specified parameters.

SpherecastFire​

FastCastParallel:SpherecastFire(
origin: Vector3,--

The origin of the spherecast.

Radius: number,--

The radius of the spherecast.

direction: Vector3,--

The direction of the spherecast.

velocity: Vector3 | number,--

The velocity of the spherecast.

BehaviorData: FastCastBehavior?--

The behavior data for the spherecast.

) → ()

Spherecasts the Caster with the specified parameters.

SetMovementModeEnabled​

FastCastParallel:SetMovementModeEnabled(
enabled: boolean,--

Is enabled

mode: "BulkMoveTo" | "Motor6D"--

The movement mode to set for casts.

) → ()

Sets the movement mode for casts.

SetObjectCacheEnabled​

FastCastParallel:SetObjectCacheEnabled(enabled: boolean) → ()

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(cast: vaildcast) → ()

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": 268,
                "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": 337,
                "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": 356,
                "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": 383,
                "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": 411,
                "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": 436,
                "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": 454,
                "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": 651,
                "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": 813,
                "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": 141,
        "path": "src/init.luau"
    }
}