Skip to main content

Record

A Types.Mover for an agent with no Model: its pivot (position and yaw) lives in a table. Exposed as VluxyAI.Movers.Record. Build an agent on it with VluxyAI.new() (no entity) or VluxyAI.Presets.Headless; the agent's Agent:GetPivot, Agent:GetPosition and Agent:Teleport all go through it, and the senses read it like they read a rig.

local agent = VluxyAI.new()
	:SetName("Goblin 12")
	:UseBrain(Brain)
	:UsePathfinder(VluxyAI.Pathfinders.Straight.new())
	:UseMover(VluxyAI.Movers.Record.new({ Position = spawn, Speed = 10 }))
	:Build()
	:Start(true)

-- your scheduler, every frame or every few:
agent:Step(deltaTime)
local pivot = agent:GetPivot()

It moves only inside Agent:Step, at the agent's tick rate, so a server that steps agents itself controls their whole cost. It is a CFrameMover in its Manual mode underneath and has all of its methods, plus Step(deltaTime).

Functions​

new​

Record.new(options: RecordOptions) → Mover

Types

​

interface RecordOptions {
Position: Vector3--

Where the agent starts. With the default HeightOffset this is the floor point under it.

Yaw: number?--

Starting yaw in radians; 0 faces -Z. Default 0.

Speed: number?--

As CFrameMover. Default 8.

TurnSpeed: number?--

As CFrameMover. Default 10.

HeightOffset: number?--

As CFrameMover, but defaults to 0, so the pivot stays the floor point.

StepDistance: number?--

As CFrameMover.

StuckTimeout: number?--

As CFrameMover.

Noise: MoverNoise?--

As CFrameMover; fired with no source instance.

}

Errors

TypeDescription
string`Position` is missing, or an option is unknown.
Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "",
            "params": [
                {
                    "name": "options",
                    "desc": "",
                    "lua_type": "RecordOptions"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Mover"
                }
            ],
            "function_type": "static",
            "errors": [
                {
                    "lua_type": "string",
                    "desc": "`Position` is missing, or an option is unknown."
                }
            ],
            "source": {
                "line": 98,
                "path": "lib/Movers/Record.luau"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "RecordOptions",
            "desc": "",
            "fields": [
                {
                    "name": "Position",
                    "lua_type": "Vector3",
                    "desc": "Where the agent starts. With the default `HeightOffset` this is the floor point under it."
                },
                {
                    "name": "Yaw",
                    "lua_type": "number?",
                    "desc": "Starting yaw in radians; `0` faces -Z. Default `0`."
                },
                {
                    "name": "Speed",
                    "lua_type": "number?",
                    "desc": "As [CFrameMover]. Default `8`."
                },
                {
                    "name": "TurnSpeed",
                    "lua_type": "number?",
                    "desc": "As [CFrameMover]. Default `10`."
                },
                {
                    "name": "HeightOffset",
                    "lua_type": "number?",
                    "desc": "As [CFrameMover], but defaults to `0`, so the pivot stays the floor point."
                },
                {
                    "name": "StepDistance",
                    "lua_type": "number?",
                    "desc": "As [CFrameMover]."
                },
                {
                    "name": "StuckTimeout",
                    "lua_type": "number?",
                    "desc": "As [CFrameMover]."
                },
                {
                    "name": "Noise",
                    "lua_type": "MoverNoise?",
                    "desc": "As [CFrameMover]; fired with no source instance."
                }
            ],
            "source": {
                "line": 64,
                "path": "lib/Movers/Record.luau"
            }
        }
    ],
    "name": "Record",
    "desc": "A [Types.Mover] for an agent with no Model: its pivot (position and yaw) lives in a table.\nExposed as `VluxyAI.Movers.Record`. Build an agent on it with `VluxyAI.new()` (no entity) or\n`VluxyAI.Presets.Headless`; the agent's [Agent:GetPivot], [Agent:GetPosition] and\n[Agent:Teleport] all go through it, and the senses read it like they read a rig.\n\n```lua\nlocal agent = VluxyAI.new()\n\t:SetName(\"Goblin 12\")\n\t:UseBrain(Brain)\n\t:UsePathfinder(VluxyAI.Pathfinders.Straight.new())\n\t:UseMover(VluxyAI.Movers.Record.new({ Position = spawn, Speed = 10 }))\n\t:Build()\n\t:Start(true)\n\n-- your scheduler, every frame or every few:\nagent:Step(deltaTime)\nlocal pivot = agent:GetPivot()\n```\n\nIt moves only inside [Agent:Step], at the agent's tick rate, so a server that steps agents\nitself controls their whole cost. It is a [CFrameMover] in its `Manual` mode underneath and\nhas all of its methods, plus `Step(deltaTime)`.",
    "source": {
        "line": 50,
        "path": "lib/Movers/Record.luau"
    }
}