So I’m using BezierPath to calculate the cframe of the enemy, But when i change the speed of the enemy it just instantly teleports ahead which is intended, However i want it to just move quicker not teleport instantly to the calculated cframe, How would i do that?
Here is the code:
game:GetService("RunService").Heartbeat:Connect(function(dt)
for _, objectValue in Enemies do
local attributes = objectValue:GetAttributes()
local t = (workspace:GetServerTimeNow() - attributes.StartTime) / (Path:GetPathLength() / attributes.Speed)
local model = objectValue.Value
if not model then
continue
end
if not model.PrimaryPart then
continue
end
if t <= 1 then
model:PivotTo(Path:CalculateUniformCFrame(t) + Vector3.new(0, getheightbyboundingbox(model) - workspace.Waypoints:GetChildren()[1].Size.Y / 2, 0))
end
end
end)