Predictions of players movement

Hello devforum!
How would I make a prediction of where a player is moving by putting like, 5 clones infront of them to their predicted position?
I have some code that predicts stuff, but I dont know how it works cause I just found it off the devforums.
How would I implement my idea into this code, or is this code not fit for my idea?

player.HumanoidRootPart.Position + player.HumanoidRootPart.Velocity
Heres some ideas I tried.
  • Delaying movement so it can be predicted easily (annoying to move tho)
  • Forcing a player to move forwards would be lame.

You can predict a position of the ‘HumanoidRootPart’ by predictedPosition(timeInterval) = position + velocity * timeInterval. This function requires a time interval so you can predict as far ahead as you want.

local function predictPosition(part, timeInterval)
    return part.Position + part.Velocity * timeInterval
end
2 Likes

Sorry I already solved this 40 minutes ago, thanks for trying to help tho!

Sorry don’t mean to bump this but, what solution did you use?

this probably

local function Predict(Humanoid, Time)
	return Humanoid.RootPart.Position + (Humanoid.MoveDirection * Time)
end

Doesn’t really work. It’s better to use Velocity, but it’s still a bit off.