Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Is Part.Velocity measured in cm/s?

Asked by
ipiano 120
10 years ago

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.

1
Just out of curiosity, why'd this get downvoted, so I don't do it again. ipiano 120 — 10y
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. adark 5487 — 10y
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. adark 5487 — 10y

2 answers

Log in to vote
1
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

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.

Ad
Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

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.

0
I was not getting studs/second. My calculation of (currentx-lastx)/(currenttime-lasttime) was resulting in the X component of Part velocity/5 ipiano 120 — 10y
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. BlueTaslem 18071 — 10y

Answer this question