I’m making an escape pod, but for some reason, even when I steer LEFT, it turns right. The VectorForce numbers are correct when I turn (e.g -1 for left, 1 for right), but for some reason it appears that the force on the X axis is always going to the right?
I have no idea why this is happening but it’s extremely frustrating. In fact, you’ll find a lot of hacky stuff in this code because I had to work around odd things like this in the physics engine. Does anyone know what I’m doing wrong?
FYI, if it’s relevant, Workspace’s gravity is 0.
rs.Heartbeat:connect(function()
--seat = VehicleSeat
--force = VectorForce
--throttle = seat.Throttle
--steer = seat.Steer
--turnspeed = 35
--speed = 50000
if seat and force and throttle ~= 0 then
steer = seat.Steer
if steer == 0 then
seat.RotVelocity = Vector3.new(0,0,0)
elseif steer == 1 then
turnspeed = maxspeed/2 --Why am I doing this? For some reason the seat was turning too fast in one direction.
else
turnspeed = maxspeed
end
seat.Velocity = Vector3.new(0,0,0) --If I don't do this, the pod's controls are weird?
rs.Heartbeat:Wait() --Myissue doesn't fix if I remove the line above.
force.Force = Vector3.new(steer * turnspeed, bar.Value * 100000, -throttle * speed)
elseif seat and force and throttle == 0 then
force.Force = Vector3.new(0, 0, 0)
seat.Velocity = Vector3.new(0,0,0)
end
end)
So, I tried to read up on Vector Forces in order to help you, and here is what I found:
This article says that movement is relative to a certain attachment, and if the attachment is not centered, that the force creates torque, which could be the reason for your pod always turning right.
I am sorry if what I am telling you is complete nonsense, I am not too familiar with VectorForces and such other than basic usage.
Thanks for taking the time to find that! I got the pod turning properly again by turning on ApplyAtCenterOfMass, but now it doesn’t face the proper turning direction, so I’d rather keep that off.
My attachment was positioned at 0,0,0 on the part. Wouldn’t that be the center? Why is more force being applied?