Skip to main content

Collision

Collision groups for agents. Call Collision.Setup once on the server, put each rig in the rig group with Collision.AddRig, and make a part agents walk through (a door, a curtain, a bead screen) with Collision.LetRigsThrough; it stays solid to players. SafeAreas uses the same rig group.

VluxyAI.Collision.Setup()
VluxyAI.Collision.AddRig(model)
VluxyAI.Collision.LetRigsThrough(workspace.Doors.Front)

Properties​

RIG_GROUP​

Collision.RIG_GROUP: "VluxyAIRigs"

PASSABLE_GROUP​

Collision.PASSABLE_GROUP: "VluxyAIPassable"

Parts in this group are solid to everything but rigs.

Functions​

Setup​

Collision.Setup() → ()

Registers the rig and passable groups and makes them not collide with each other. Safe to call more than once.

AddRig​

Collision.AddRig(
model: Model,--

The rig.

group: string?--

Default Collision.RIG_GROUP.

) → Cleaner--

Destroy it to stop assigning parts added later.

Puts every part of the rig, now and as parts are added, in the rig group.

LetRigsThrough​

Collision.LetRigsThrough(
part: BasePart,
passable: boolean?--

false puts it back in Default, solid to rigs again (a door that was locked). Default true.

) → ()

Makes a part something agents walk through while it stays solid to players.

Show raw api
{
    "functions": [
        {
            "name": "Setup",
            "desc": "Registers the rig and passable groups and makes them not collide with each other. Safe to call\nmore than once.",
            "params": [],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 66,
                "path": "lib/World/Collision.luau"
            }
        },
        {
            "name": "AddRig",
            "desc": "Puts every part of the rig, now and as parts are added, in the rig group.",
            "params": [
                {
                    "name": "model",
                    "desc": "The rig.",
                    "lua_type": "Model"
                },
                {
                    "name": "group",
                    "desc": "Default [Collision.RIG_GROUP].",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "Destroy it to stop assigning parts added later.",
                    "lua_type": "Cleaner"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 80,
                "path": "lib/World/Collision.luau"
            }
        },
        {
            "name": "LetRigsThrough",
            "desc": "Makes a part something agents walk through while it stays solid to players.",
            "params": [
                {
                    "name": "part",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "passable",
                    "desc": "`false` puts it back in `Default`, solid to rigs again (a door that was locked). Default `true`.",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 103,
                "path": "lib/World/Collision.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "RIG_GROUP",
            "desc": "",
            "lua_type": "\"VluxyAIRigs\"",
            "source": {
                "line": 40,
                "path": "lib/World/Collision.luau"
            }
        },
        {
            "name": "PASSABLE_GROUP",
            "desc": "Parts in this group are solid to everything but rigs.",
            "lua_type": "\"VluxyAIPassable\"",
            "source": {
                "line": 48,
                "path": "lib/World/Collision.luau"
            }
        }
    ],
    "types": [],
    "name": "Collision",
    "desc": "Collision groups for agents. Call [Collision.Setup] once on the server, put each rig in the rig\ngroup with [Collision.AddRig], and make a part agents walk through (a door, a curtain, a bead\nscreen) with [Collision.LetRigsThrough]; it stays solid to players. [SafeAreas] uses the same\nrig group.\n\n```lua\nVluxyAI.Collision.Setup()\nVluxyAI.Collision.AddRig(model)\nVluxyAI.Collision.LetRigsThrough(workspace.Doors.Front)\n```",
    "source": {
        "line": 35,
        "path": "lib/World/Collision.luau"
    }
}