Constant lerp speeds?

So I’m using a lerp to make my bullet have a curved flight. Here is the code

local NewBezier =, p2, p1)
for t = 0,1,0.0165 do--0.0165
	local position = NewBezier:CalculatePositionAt(t)
	local derivative = NewBezier:CalculateDerivativeAt(t)
	TweenService:Create(bullet,, {CFrame =, position + derivative)}):Play()
	bullet.CFrame =, position + derivative)

(I’m using this module if your curious Bhristt's Bezier Curve Module (Tween support)

Currently, the bullet will fly faster for slower for shorter shots.
The problem: I want the bullet to go at the same speed no matter how far/close the shot was.

Any replies are appreciated. Thank you!

edit: I relized there was something that I didn’t mean to put in the code but it’s fixed now.


I’m blind and can’t see the position of commas.

The module link appears to not work for me i get this screen

1 Like

Sorry, something was wrong with the link but I fixed it now.

To get a constant time, you need to have the distance and speed unit that you want the bullet to travel.
Using code that would look like this:

local distance = (bullet.Position - yourFinalPosition).Magnitude
speed = 300
local time = (distance/speed)

Where distance is the difference between your origin position and end position.
You also don’t really need a module to have a curved flight path. There is a projectile motion equation you can use that makes it very simple to model.

   local TIME_TO_DESTINATION = 0.5
   local gravityVector =, -workspace.Gravity, 0)
   --calculating the velocity needed to reach the destination
   local velocityForDestination = (destinationPosition - originPosition - (gravityVector * TIME_TO_DESTINATION^2)/2)/TIME_TO_DESTINATION

   --Air travel using Cframe
   local airTime = 0
   local connection = nil
   connection = RunService.Heartbeat:Connect(function(dt)
      if airTime < TIME_TO_DESTINATION then
         bullet.CFrame = + velocityForDestination * airTime + gravityVector * airTime^2 / 2)
         airTime = airTime + dt