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

How do you get the velocity of an object? [SOLVED BY PERCI1]

Hello everyone, Today I have a question, it is for my largest project, let me explain, do you know the difference between velocity and speed?

Well Speed is the amount of distance traveled per unit of time. So 300m/s means each second you travel 300 meters.

But Velocity is different, it also gives you speed but it includes the direction of its movement, so you can say 300m/s 60 degrees east, it says you travel 300 meters 60 degrees east every second.

So I need to Velocity, not Speed, I need the variables like this:

local speed = --speed here
local direction --direction here

The only problem is that in direction I need it to be in 3D points, so people told me to use CFrame, but I don't know how to get the angle of its movement, FE is disabled, if I enable it my tool scripts will break and I don't want to script 1k lines for each tool again. Can anyone help me? Remember, I need it to be the angle of which it is moving, NOT the actual rotation of the part.

Maybe I need to get the CFrame every 1/10 second and compare the 2 latest ones to make it an angle using math, but how do you do it??????

4 comments

0

No, I also need the direction

0

Take the question down if it's been solved.

0

I won't take it down, It might server as a reference for other people.

1 answer

This question has been solved by Perci1

It is part.Velocity

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