The Rigidbody class works with the physics of the object. Requires the Rigidbody component to function.
The angular drag of the object.
-- Set a new angular drag value
obj.Rigidbody.AngularDrag = 0.20;
-- Get the current angular drag value
Space.Log(obj.Rigidbody.AngularDrag);
The angular velocity vector of the rigidbody (in radians per second).
-- Set a new angular velocity value
obj.Rigidbody.AngularVelocity = Vector.New(0,Space.Math.Pi,0);
-- Now the object rotates about the Y axis at a speed of 180 degrees per second
-- (or 30 revolutions per minute)
-- Get the current angular velocity value
Space.Log(obj.Rigidbody.AngularVelocity);
The center of mass relative to the local origin.
-- Set a new center of mass
obj.Rigidbody.CenterOfMass = Vector.New(1,0,0);
-- Now the object's center of mass has been moved by 1 at the X axis
-- Get the current center of mass
Space.Log(obj.Rigidbody.CenterOfMass);
The drag of the object.
-- Set a new drag value
obj.Rigidbody.Drag = 20;
-- Now the object's drag is set to 20 - the higher the number, the more it is resistant to gravity
-- Get the current drag value
Space.Log(obj.Rigidbody.Drag);