Is there a way to make npc's walk smoothly?

For the ones that have the same problem here’s a script for making a path smoothly!

local pointsFolder = workspace.Points

local startPoint = pointsFolder.Start -- start part
local endpoint = pointsFolder.End -- end part

local middlePoint = pointsFolder.Middle-- control part

local function LinearBezier(start, finish, t)
	local range = finish-start
	
	return start + range*t
		
	
end

local function ConstructLinearBezier(start, finish)
	local range = finish-start
	return function(t)
		return start + range*t
	end
end




local function Point(position)
	local part = script.Point:Clone()
	part.CFrame = CFrame.new(position)
	part.Parent = workspace
	part.Anchored = true
	return part
	
end

local Line1 = ConstructLinearBezier(startPoint.Position, middlePoint.Position)
local line2 = ConstructLinearBezier(middlePoint.Position, endpoint.Position)


for t = 0, 1, 0.1 do
	local x1 = Line1(t)
	local x2 = line2(t)
	
	Point(x1)
	Point(x2)
	
	Point(LinearBezier(x1, x2, t))
	
end

You can change the part’s position so it will add up with your willings.

3 Likes