Hello, I am working on a custom non humanoid character but a issue is that the server part moves too fast for the actual character to follow
here’s a vidoe, how should I calculate this?
as you see the npc model is a little far behide then the server part
and here’s the code, the task.wait() is the speed of how fast the server part is moving
local function coroutineFunc()
for i, waypoint in waypoints do
local lookDirection = (aiModelRoot.Position - waypoint.Position).Unit
local newCFrame = CFrame.lookAt(aiModelRoot.Position, waypoint.Position + lookDirection)
aiModelRoot.CFrame = newCFrame
aiModelRoot.Position = waypoint.Position + Vector3.new(0, aiModelRoot.Size.Y / 2, 0)
local distance = (aiModelRoot.Position - waypoint.Position).Magnitude
task.wait(distance / self.WalkSpeed)
self.ReadyForUpdate = true
break
end
end
I’m deviding it by the distance and walkspeed but that really only works with tweenservice