TD movement library, specially created for MelonBytes Studio
sumer9999dev/[email protected]
SUMER (@sumer_real) - developing this library
ecurtiss (@ecurtiss) - for creating CatRom library
Create path:
-- Forward.Path(effect, alpha, tension, ...points)
local path = Forward.Path(
render_stepped_effect, 0.5, 0.6,
{
Vector3.new(100, 10, 100),
Vector3.new(110, 10, 150),
Vector3.new(120, 10, 200)
},
workspace.point_4,
{
workspace.point_5,
workspace.point_6
}
)
Create effect for path:
local function render_stepped_effect(callback)
local connection = game:GetService('RunService').RenderStepped:Connect(callback)
return function() connection:Disconnect() end
end
Start path:
path:start()
Stop path:
path:stop()
Solve cframe at point:
path:solve_cframe(0.1)
Walker:
local walker = path:walker(10) -- 10 is start speed
walker.speed = 15 -- you can edit speed in runtime
walker:on_update(function(point: CFrame)
print(point.Position)
end)
walker:on_reached(function()
print('reached')
end)
path:remove_walker(walker) -- also you can remove walker