How can I tween faster based on NPC speed?

Hello everyone,

I’m making NPC walk using tweens and I’m not sure how can I implement speed in the tween.

Code:

local Tween = TweenService:Create(self.Part,TweenInfo.new(self.Speed,Enum.EasingStyle.Linear),{Position = Destination})

as you can see if the more “Speed” the NPC has the slower it gets (which is the opposite of what I want), is there a way to do it probably?

Thank you. :grinning:

That parameter is “time” not “speed” so you have to pass it “distance to travel / speed” instead.

Have you considered using something like Humanoid:MoveTo which might be easier to use?

I’m aware that it’s time and not speed (should have specified more). And I’m using it on non-humanoid NPCs so Humanoid:MoveTo() isn’t really an option :sweat:.

speaking of distance, how would I get it?

(Destination - self.Part.Position).Magnitude should give you the travel distance

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.