Is that an issue? You could just calculate the distance to the next node, and multiply it by the speed or the NPC, and move it to the next node. I’m not sure hoe to fix this, but this should give the same effect.
If you are using tweens, you would get the distance from this Node, to the next one, lets say (1), and multiply/divide it by speed, and you should get the time to tween. So to start, if the next node was 5 studs away, and the speed was 2, you would get 5/2 = 2.5, and that would be the time of the tween.
But for the closer ones, say .25 studs apart, .25/2 would give you .125, which would result in the same speed. You just need to multiply/divide distance by speed, and you should be good. How are you moving the NPC?
Usually i used the TweenService, but the path always looked like it was going into a linear direction.
--Cammina
TweenService:Create(
Temp,
TweenInfo.new(5,Enum.EasingStyle.Sine,Enum.EasingDirection.In),
{CFrame = Posto.CFrame}
):Play()
--Cammina
while Temp.CFrame ~= Posto.CFrame do
Clone:SetPrimaryPartCFrame(Temp.CFrame)
wait(0.01)
end
Clone:SetPrimaryPartCFrame(Posto.CFrame)
I am trying to make a method to have the NPC move in a curve, but i have no idea how to do so. I tried with a for cycle around the parts of a curve changing the CFrame, but it looks off and robotic.
I heard for smooth moving and rotating, you could use lerping, but I’m not sure how to do that, and with many Npc’s it may be more performance heavy than tweens.