path — Luau Binding
require("path"): waypoint-following, splines, and steering behaviours that drive motion. The programmatic surface of the path system. Every function is[antos].
Status: design. Not built yet.
local path = require("path")
| Call | Returns | Does |
|---|---|---|
path.waypoints(target, points, opts?) |
handle |
follow points in order; opts = { loop, pingpong, speed, tolerance } |
path.spline(target, points, opts?) |
handle |
follow a smooth curve through points |
path.seek(target, goal, opts?) |
handle |
steer toward goal (a point or another target); opts = { speed, arrive } |
path.flee(target, goal, opts?) |
handle |
steer away from goal |
path.stop(target) |
ok |
end path control (leaves the target where it is) |
local path = require("path")
path.waypoints(guard, { {100,100}, {300,100}, {300,300} }, { loop = true, speed = 60 })
path.seek(enemy, hero, { speed = 90, arrive = 40 }) -- chase, easing in near the player