So, I am trying to insert a BodyVelocity into a player’s HumanoidRootPart (while they have walkspeed and jumppower of 0) and move them a set number of studs in a specific amount of time with it. Here is how I insert it.
local boost = script.BodyVelocity:clone()
local distance = 40
local t = .3
boost.Velocity = (direction * distance) / t
boost.Parent = root
boost.DestroyAfterTime.Disabled = false
wait(t)
The reason the distance and time it takes to go that distance is so important is because I need to calculate the precise CFrame of the player’s HumanoidRootPart at the exact moment they stop. During testing, the CFrame is usually being calculated too early because they BodyVelocity must continue moving the player even after the designated time has elapsed via wait(t).
Any suggestions for how to make them stop on a dime would be appreciated.