BodyForce is the base that BodyPosition and BodyVelocity build on. The two objects apply forces based on a configurable PID system to get the desired behavior.
BodyGyro and BodyAngularVelocity are like BodyPosition and BodyVelocity, respectively. Unfortunately, there is no BodyForce analog. Several times I have had the great idea to use a torque on vehicle wheels to be able to simulate the inner mechanics behind the vehicle (engine performance, alternator excitation, etc.), but every time, I realize that a BodyTorque object does not exist.
It would be great to get an object that applies a torque to an assembly in the object’s parent’s local coordinates.
You wouldn’t suggest using BodyPosition and BodyVelocity as a BodyForce, would you?
Plus, BodyAngularVelocity is measured in global coordinates, not local coordinates.
Please, read carefully and look up things that are mentioned. A lot of posts have wrong or misleading information in them because the poster didn’t look up important information or assumed they knew what was being talked about.
There’s a missing piece here. Position and Gyro attempt to reach a specific position using P and D for system control, using forces or torques under the constraints of max force/torque.
Velocity and Angular Velocity attempt to maintain a constant rate of movement with a given P using forces or torques under the constraints of max force/ torque.
BodyForce is the raw stuff used by BodyPosition and BodyVelocity. We’re missing that from the rotational set of movers.
You should be able to pull off the effect by using two or more BodyThrusts that apply forces in opposing directions to cancel out the linear momentum given to the part. Observe:
local part = Instance.new('Part')
part.TopSurface = 0
part.BottomSurface = 0
part.Shape = 'Cylinder'
part.Size = Vector3.new(4,4,4)
part.Position = Vector3.new(0,2,0)
-- BodyThrusts for rotation
local bt0 = Instance.new('BodyThrust', part)
bt0.location = Vector3.new(0,2,0,0)
-- Apply force in opposite direction to negate linear momentum
local bt1 = bt0:Clone()
bt1.location = -bt1.location
bt1.Parent = part
part.Parent = workspace
-- Alternate between forward and backward
bt0.force = Vector3.new(0,0,-10*part:GetMass())
bt1.force = -bt0.force
wait(1)
while true do
bt0.force = Vector3.new(0,0,20*part:GetMass())
bt1.force = -bt0.force
wait(1)
bt0.force = Vector3.new(0,0,-20*part:GetMass())
bt1.force = -bt0.force
wait(1)
end
[quote] You should be able to pull off the effect by using two or more BodyThrusts that apply forces in opposing directions to cancel out the linear momentum given to the part. Observe:
[code]
local part = Instance.new(‘Part’)
part.TopSurface = 0
part.BottomSurface = 0
part.Shape = ‘Cylinder’
part.Size = Vector3.new(4,4,4)
part.Position = Vector3.new(0,2,0)
– BodyThrusts for rotation
local bt0 = Instance.new(‘BodyThrust’, part)
bt0.location = Vector3.new(0,2,0,0)
– Apply force in opposite direction to negate linear momentum
local bt1 = bt0:Clone()
bt1.location = -bt1.location
bt1.Parent = part
part.Parent = workspace
– Alternate between forward and backward
bt0.force = Vector3.new(0,0,-10part:GetMass())
bt1.force = -bt0.force
wait(1)
while true do
bt0.force = Vector3.new(0,0,20part:GetMass())
bt1.force = -bt0.force
wait(1)
bt0.force = Vector3.new(0,0,-20*part:GetMass())
bt1.force = -bt0.force
wait(1)
end
[/code] [/quote]
That is a good point about the Offset, I forgot about that. It feels a little like a hack to do that, though, but that looks like it would work.