Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to multiply velocity to get position after a time?

Hello if somebody has 0,0,20 velocity and the action takes 0.5 seconds then how can I multiply the velocity to get their position? I am just asking for a method i should do this not the actual code

i have tried velocity.lookvector but it does not exist

6 comments

0

Do you mean the magnitude (distance) between your old position and the new position?

0

No i want to know how to multiply their velocity to predict their position after 0.5 seconds if velocity is studs per seconds then how would i multiply the velocity to calculate the studs

1

stop botting this so hard, 200 views not possible

0

l0l

0

uh magnitude is easier to calculate, use that.

0

Sorry for the views i refresh ed m a lot

1 answer

✓ Accepted answer

This is simply a matter of multiplying the velocity by the time and adding the starting position to it. It is quite simple:

newPosition = startingPosition + velocity * time

newPosition, startingPosition, and velocity are all vectors. Therefore you can add and multiply them together like this. Vectors can also be multiplied by scalars (numbers) and it will scale them accordingly.

1 comment

0

Thank you so much sorry for accepting your answer 5 hours late I fell asleep

This discussion is preserved as it was. New answers, comments, and votes are closed.