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

Is Part.Velocity measured in cm/s?

I've been working on writing my own custom Fly Script so that planes will appear weightless and react as if in space; and one of the things I've come across is that my calculation of velocity does not equal part.Velocity. It equals part.Velocity/5. I'm using a general distance/time script to calculate velocity. So my calculation is also calculating studs/second.

The wiki page for gravity says that one stud = 5 cm, because the gravitational constant in Roblox is 196.2, so that means my calculations are also calculating 5cm/second. And since the velocity property of parts is 5*my calculation, then that must be cm/second.

I'm just making sure that I have this correct, I believe so, but I wanted other peoples' opinions on it. I would like to use meters/second as my units, but that might result in tiny numbers, and before I tune my PID loop, I want to make sure I'm using the right scale of units.

3 comments

1

Just out of curiosity, why'd this get downvoted, so I don't do it again.

0

There is no "correct" scale of units to use. m/s and cm/s are just two representations of the same number. If you can get it to work, just make a note of the units you're using.

0

And to answer your other question: people tend to get a bit overzealous here with the "if it ain't a Lua question, downvote it" rule, when they vote at all. I for one think this is an excellent question.

2 answers

Like I said in my comment, there is no "correct" way to choose your units, just use whatever fits best. One meter per second is 100 centimeters per second for a reason.

If you want to use m/s, use it and remember that. If you want to use cm/s, go ahead.

Personally, I would go with numbers that scale to about 1 unit/s for whatever your calculation is, to negate as much error as possible while still using smallish numbers. If cm/s is that, go ahead and use it.

Velocity is measured in studs / second. You should not be getting measurements that suggest otherwise. I have just run the measurements myself and had only an error of 3%.

There isn't really a consistent scale to the real world, so you can choose an arbitrary length to be a meter.

2 comments

0

I was not getting studs/second. My calculation of (currentx-lastx)/(currenttime-lasttime) was resulting in the X component of Part velocity/5

0

I ran that, and for sure got velocity * 97%. I have also run this in the past and have gotten the result of studs / second.

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