generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Object's Weight

Previous Thread :: Next Thread 
BattleBloxRBX is not online. BattleBloxRBX
Joined: 27 Nov 2013
Total Posts: 69
29 Nov 2013 09:53 AM
Hello,

I'm trying to calculate the "weight" of an object. Reason being is, I have a BodyVelocity inside my part, but the part is too "heavy" and the velocity when set to 0,0,0 lets the part slowly fall to the ground. A 0.15 on the Y axis (0,0.15,0) helps, but it stills moves slowly to the ground. Is there a way I can calculate the weight of a part, and then calculate how much force is needed on the Y axis to keep it from falling?

Cheers,
BattleBloxRBX
Report Abuse
BattleBloxRBX is not online. BattleBloxRBX
Joined: 27 Nov 2013
Total Posts: 69
29 Nov 2013 10:04 AM
UPDATE:

A 1x1x1 part requires 0.16 of power on the Y axis (0,0.16,0) to stay stable. I then tried make the cube 2x2x2 (Please also note, I am basing this off of the Symmetric part size system) and then multiplying 2 times 2 times 2 (Getting 8) and then multiplied 8 times 0.16 (The 8 comes from the part's GetMass() function, which just returns the volume, which is X times Y times Z, so a 2x2x2 part's Mass is going to be 2 times 2 > 4, and then times 2> 8) But unfortunately it falls downwards.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
29 Nov 2013 10:05 AM
Weight = Mass * Gravitational accelaration

You use BodyForce for this, not BodyVelocity. You can get the mass by calling GetMass() on the Part. As for the gravity, try using 196.2 (not sure though).
Report Abuse
BattleBloxRBX is not online. BattleBloxRBX
Joined: 27 Nov 2013
Total Posts: 69
29 Nov 2013 10:28 AM
Hello,

I'm using BodyVelocity because I need to for something else in my code. I tried using BodyForce on a 1x1x1 object, and set the Y value to 196.2 (As stated on the Wiki, as well as by you) and it just plopped right down to the ground. Not even slowed.

As far as I can see, I've had more luck with using BodyVelocity, so I'll stick with that until I get a solution.

Thanks,
BattleBloxRBX
Report Abuse
BattleBloxRBX is not online. BattleBloxRBX
Joined: 27 Nov 2013
Total Posts: 69
29 Nov 2013 10:36 AM
Aha!

Solution to overcoming the weight on ANY SIZED object. Set the Velocity of a BodyVelocity to 0.16 on the Y axis. Set the maxForce to "inf" (Vector3.new(math.huge,math.huge,math.huge), this cannot be set by typing "inf" into the objects property value). This will overcome ANY weight from ANY SIZED objects.

In case you'd like to know, I used BodyVelocity so I can create "plane" like objects that will be widely used in a game I'm developing.

Thanks and Cheers,
BattleBloxRBX
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
29 Nov 2013 10:40 AM
you were supposed to multiply that by the mass but ok
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
29 Nov 2013 10:45 AM
part = Instance.new("Part",Workspace)
bodyforce = Instance.new("BodyForce",part)
bodyforce.force = Vector3.new(0,bodyforce.Parent:GetMass()*196.2,0)

lol it works for me
Report Abuse
BattleBloxRBX is not online. BattleBloxRBX
Joined: 27 Nov 2013
Total Posts: 69
29 Nov 2013 10:46 AM
I tried that on a 1x1x1 part. Meaning GetMass()*196.2 would just be 196.2 (Since 1*196.2 = 196.2), and it did nothing. I may have been doing something wrong, but I found a solution that works with my already written code. Thanks for the help.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image