# Workspace:GetGravity()

We can all memorize 196.2 but it’d be cleaner and nicer on new studio users to have a function that returns a Vector describing the acceleration of gravity in studs/s/s. Also would be helpful whenever we get around to making the physics engine gravity changeable.

Yes, but like you said it’d only be practical if we could manipulate gravity.

And for new users.

And for new users.[/quote]

That’s what the wiki is for, there shouldn’t be constant values as properties, really.

Actually that’s a perfectly valid reason to make it a property. It definitely shouldn’t be a function.

Actually that’s a perfectly valid reason to make it a property. It definitely shouldn’t be a function.[/quote]

I think he meant that it shouldn’t be a member of the workspace Instance in any fashion because it is constant – not that it shouldn’t be a property if added, but just not be added period.

It’s not a big deal to add and it would be convenient. Why not?

196.2 is not easy to remember

I have to dig through old tools to find that number, and it usually comes in the form of like, 392/2 or something (which isn’t even correct)

:GetGravity() would help with this, and would also help tools that are being distributed as models to readjust on a game per game basis, based on that game’s default gravity, whatever it has it set to. (in the future maybe)

What – you don’t even have to remember 196.2.

What is gravity?

9.81 m/s^2

But ROBLOX doesn’t use meters – it uses studs.

How many studs in a meter?

20 – you should be aware of this by now

If 20 studs are in a meter that means we have to multiple 20 by #meters in gravity.

20*9.81 = 196.2

Nothing to remember – it’s just simple math

[quote] What – you don’t even have to remember 196.2.

What is gravity?

9.81 m/s^2

But ROBLOX doesn’t use meters – it uses studs.

How many studs in a meter?

20 – you should be aware of this by now

If 20 studs are in a meter that means we have to multiple 20 by #meters in gravity.

20*9.81 = 196.2

Nothing to remember – it’s just simple math [/quote]

Just because it can be done without it doesn’t mean it’s not still useful.

inb4 workspace:SetGravity(float)

[quote] What – you don’t even have to remember 196.2.

What is gravity?

9.81 m/s^2

But ROBLOX doesn’t use meters – it uses studs.

How many studs in a meter?

20 – you should be aware of this by now

If 20 studs are in a meter that means we have to multiple 20 by #meters in gravity.

20*9.81 = 196.2

Nothing to remember – it’s just simple math [/quote]

Just because it can be done without it doesn’t mean it’s not still useful.[/quote]

I’ll just let the admins explain to you why this isn’t a good idea (assuming it isn’t able to be modified) when you start your internship. Make sure to bring this up there.

Actually that’s a perfectly valid reason to make it a property. It definitely shouldn’t be a function.[/quote]

WELL GUESS WHAT. IT’LL BE A FUNCTION ANYWAY BECAUSE __index.

[quote] What – you don’t even have to remember 196.2.

What is gravity?

9.81 m/s^2

But ROBLOX doesn’t use meters – it uses studs.

How many studs in a meter?

20 – you should be aware of this by now

If 20 studs are in a meter that means we have to multiple 20 by #meters in gravity.

20*9.81 = 196.2

Nothing to remember – it’s just simple math [/quote]

Yeah, remembering that entire formula or any specific numbers in that formula is way easier than just knowing the answer straight up. Why do you assume the stud to meter conversion rate, and the exact rate of gravity (in meters) is common knowledge to EVERYONE that is scripting?

[quote] What – you don’t even have to remember 196.2.

What is gravity?

9.81 m/s^2

But ROBLOX doesn’t use meters – it uses studs.

How many studs in a meter?

20 – you should be aware of this by now

If 20 studs are in a meter that means we have to multiple 20 by #meters in gravity.

20*9.81 = 196.2

Nothing to remember – it’s just simple math [/quote]

Yeah, remembering that entire formula or any specific numbers in that formula is way easier than just knowing the answer straight up. Why do you assume the stud to meter conversion rate, and the exact rate of gravity (in meters) is common knowledge to EVERYONE that is scripting?[/quote]

How to put this. Because someone is too lazy to use Google to find out how gravity works on ROBLOX, ROBLOX should add a property that tells them something that would have taken only seconds to find outside of Studio? A property that means nothing to anyone but the miniscule amount of people working with gravity on ROBLOX? A property which isn’t even modifiable?

I mean come on – they even have the wiki integrated into studio. Sorry, but no way José will they be adding a property to the API for something you can find with a quick google search.

[quote] [quote=“Echo” post=149999]What – you don’t even have to remember 196.2.

What is gravity?

9.81 m/s^2

But ROBLOX doesn’t use meters – it uses studs.

How many studs in a meter?

20 – you should be aware of this by now

If 20 studs are in a meter that means we have to multiple 20 by #meters in gravity.

20*9.81 = 196.2

Nothing to remember – it’s just simple math [/quote]

Yeah, remembering that entire formula or any specific numbers in that formula is way easier than just knowing the answer straight up. Why do you assume the stud to meter conversion rate, and the exact rate of gravity (in meters) is common knowledge to EVERYONE that is scripting?[/quote]

How to put this. Because someone is too lazy to use Google to find out how gravity works on ROBLOX, ROBLOX should add a property that tells them something that would have taken only seconds to find outside of Studio? A property that means nothing to anyone but the miniscule amount of people working with gravity on ROBLOX? A property which isn’t even modifiable?

I mean come on – they even have the wiki integrated into studio. Sorry, but no way José will they be adding a property to the API for something you can find with a quick google search.[/quote]

The amazing thing with properties is that they are there so you can change them. (most of the time, anyway)
However, instead of it being ‘196.2’ it should be ‘20’ as that signifies studs->metres, which makes it easier for people to modify without having to know the formula to turn metres into studs.

And if we still want to get the gravity as it would be, workspace:GetGravity() could exist.

[quote]
However, instead of it being ‘196.2’ it should be ‘20’ as that signifies studs->metres, which makes it easier for people to modify without having to know the formula to turn metres into studs. [/quote]

Nope nope nope. It should be msec^-2studsm^-1. Which currently is a value of 196.2 studss^-2. The property is supposed to make things easier, and having the value stored as the ratio of studs to meters does not help anything because people then have to go on the terrible no good very bas google and find out that a stud is 1/20 of a meter, making the whole point of making it a property a moot one.

As for you echo:

Davidii isn’t just ‘someone who is too lazy to use google,’ and lazyness isn’t always the reason for not looking it up. First, lack of confidence, ignorance of google (it can happen) or ignorance of the wiki can also contribute.
Second, read-only properties exist, you know. Why do they expose Game.CreatorId if you can’t change it? It’s obviously stupid.

Third, forwards-compatability. If, at some point, roblox decides to let people change gravity, then this makes it hella easy for users. Hook up a connection to workspace.Changed, activate when gravity changes, easy as pie (which actually can already be done because properties are referred by string, so the script won’t break if [font=consolas]Type~=“Gravity”[/font]).

Fourth, it may inspire people to make gravity-defying things. Remember those people up at the beginning who were too ignorant, too scared or “too lazy” to look up the constant on google? This would give them the ability to.

Fifth, these guys are asking for this for the same reason we want SystemMenu to stay: the alternative is really annoying (in this case the alternative is that the gravity constant is not added).

Because game.CreatorId isn’t constant – it can change based on who created the game. Gravity is always constant and will never change.

I would love if we could change gravity, but until we can a constant, read-only property has no place in the API.

It may give a couple people the push to do that, but you’re forgetting about the tens of thousands of non-scripters who use Studio. It’s just a waste of a property.

[quote]
Fifth, these guys are asking for this for the same reason we want SystemMenu to stay: the alternative is really annoying (in this case the alternative is that the gravity constant is not added). [/quote]
What? How is Googling+Memorizing that there are 20 studs in a meter really annoying?

[quote] [quote=“Echo” post=149999]What – you don’t even have to remember 196.2.

What is gravity?

9.81 m/s^2

But ROBLOX doesn’t use meters – it uses studs.

How many studs in a meter?

20 – you should be aware of this by now

If 20 studs are in a meter that means we have to multiple 20 by #meters in gravity.

20*9.81 = 196.2

Nothing to remember – it’s just simple math [/quote]

Just because it can be done without it doesn’t mean it’s not still useful.[/quote]

I’ll just let the admins explain to you why this isn’t a good idea (assuming it isn’t able to be modified) when you start your internship. Make sure to bring this up there.[/quote]

Isn’t this a little unnecessary? I don’t understand why you’re fighting so hard against this. I don’t want to be saying this precisely, but it sounds like what you’re saying is “I memorized it so everyone else should too.” That might not be what you are saying, but its what it sounds like you’re saying.

True or not this API change would surely be easy to make on the dev side, more useful than not, and helpful for when we will someday get the ability to change gravity. The problem I have with your arguments is that you’re not listing any cons for this API change – all you’re saying is that it can already be done. It has pros, and no cons that you or I can think of, so why not consider it?

I’m “fighting” against it because it’d be a terrible addition to the API.

" It has pros, and no cons that you or I can think of"
I can’t remember where from, but in a programming book I read (I think it was in one of the ones an admin linked here once), it gave the following advice (or something around the lines of this)

“Programmers often spend too much time working on code completely unrelated to the objective of the program. Days could be spent on a fancy module that doesn’t even really do anything. When considering new features, the feature should start off with negative points – the lowest grade possible. In order for it to be added, it has to be so useful that it digs itself out of the hole.”

“Because why not?” Doesn’t cut it – that’s a terrible reason for something to be added to the API, or any program. If ROBLOX adds a way to manipulate gravity, then I will welcome a modifiable gravity property with open arms on my knees. Until then, the answer to “Why not?” is that it isn’t useful enough to be added to the API. Not a lot of people work with gravity, so adding something to the API that only a few people use is not only a waste of time but API bloat.

Please do follow up with this when you start your internship. I have no doubt in my mind the staff will concur. I say this not to be harsh, but because I know that no matter what I say you won’t listen to me – you will listen to them though.