Objects that inherit from the BodyMovers structure are used to move Parts against
gravity and other forces.
Force, MaxTorque, and MaxForce
All BodyMovers objects have either a
MaxTorque or MaxForce property which function the same. These are Vector3 properties and depending on the amount of each axis (X,Y,Z) will be the maximum amount of force that can be applied to that axis.
BodyPosition.MaxForce = Vector3.new(0, 1000, 0)--no movement on any axis but the Y-axis.
P is the amount of power used to reach a goal. The higher the P value, the faster it will move towards its goal and sometimes even surpass the goal. If set too low, the object might not even move.
D is the amount of damping that will be used. Damping will stop the object from surpassing its goal and having to turn around. By setting a good D, it will start to slow down as it reaches its goal so that it does not go past it. The higher the D value, the more it will slow down.
BodyAngularVelocity is used to set a constant rotational velocity. This means it can be used to turn your part even without other forces acting upon it.
BodyAngularVelocity/AngularVelocity property controls rotation. Its direction is the axis which the part rotates around, and the magnitude is the speed in radians per second at which it does it.
BodyVelocity is used to set a constant velocity. This means that it can be used to move your part at a constant speed despite gravity.
BodyVelocity/Velocity property is the maximum speed at which an object can go while being pushed by the BodyVelocity object.
BodyVelocity.Velocity = Vector3.new(0, 1000, 0)--sends the part at a constant speed upward
BodyForce will push a part with the magnitude and direction of the
BodyForce/Force property, in world coordinates.
-- push a 4,1.2,2 part upward, regardless of orientation BodyForce.Force = Vector3.new(0, 1915.52, 0)
BodyThrust is similar to BodyForce, however, its force works in relation to the object. The
BodyThrust/Force property defines the direction and magnitude the part should be pushed, in object coordinates. The
BodyThrust/Location property defines the position where the thrust is being applied, once again in object coordinates.
-- push a 4,1.2,2 part upward, with the center of thrust at the underside of the part BodyThrust.Location = Vector3.new(0, -0.6, 0) BodyThrust.Force = Vector3.new(0, 1915.52, 0)
BodyPosition moves a brick towards a certain Vector3 point ignoring gravity. The
BodyPosition/Position property defines the spot in which the part will attempt to move towards.
--Moves part towards center of the world BodyPosition.Position = Vector3.new(0, 0, 0)
BodyGyro attempts to keep a fixed orientation of the part relative to its
BodyGyro/CFrame property. This means it will try to rotate the brick to match the rotation of the CFrame.
--Rotates the brick to stay at a rotation of CFrame.Angles(math.pi / 2, 0, 0) BodyGyro.CFrame = CFrame.Angles(math.pi / 2, 0, 0)
RocketPropulsion is used to mimic the movement of a projectile. RocketPropulsion has a lot of unique properties that can be used for maximum results.
RocketPropulsion/Targetis the Part that the RocketPropulsion is shooting at.
RocketPropulsion/TargetRadiusis the distance the part must be from its target to trigger its
RocketPropulsion/TargetOffsetis how far from the target to shoot.
RocketPropulsion/CartoonFactoris how much the part points towards its target. 0 is pointing straight up away from the target, 1 is directly at the target. The default is 0.7 in order to counter the force of gravity.
RocketPropulsion/MaxSpeedis a number that defines the maximum speed that the part is allowed to reach.
Dproperties that signify the turning Power and Dampening of the projectile.
Dproperties that signify the movement Power and Dampening of the projectile.