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

Physics in Lua?

Asked by 10 years ago

I know many people say there are physics in Lua. What does that mean? Like the physics in science? Can you provide some examples too please?

2 answers

Log in to vote
1
Answered by
TheMyrco 375 Moderation Voter
10 years ago

Do not forget that the gravitational force is exactly 196.2.

So if you put a BodyForce object into a huge part and set the y value of the force to 196.2x whereas x equals the mass of the part, then it will stay, float.

This can or cannot be of use, that's upto you. One last thing, you can easily get the mass of a part by using the GetMass() method. Basically the mass is all size axises multiplied, which this function does for you.

Say you have a part with a size of Vector3(10, 7, 4) then the mass would be 10×7×4 = 70×4 = 280. For models with multiple parts I'd recommend to either place BodyForces in each indivudual part or to put a BodyForce in a central brick with all masses added up as the y value.

Yes, I drifted off quickly there lol.

Ad
Log in to vote
0
Answered by 10 years ago

What they mean if that with LUA, you can create many physics-simulation engines: rope physics, electrical simulations, forces system with Newton's laws, ...

0
(PS Lua is not an acronym, it means 'moon' in portuguese.) This is mostly accurate, but you should probably mention that 'they' could also be reffering to ROBLOX's physics engine, and the Body* objects that allow for distortions within the system without having to use scripting. adark 5487 — 10y

Answer this question