I am currently having issues making the aircraft turn realistically, I have seen multiple ways of doing this, and this is the equation I used to get centripetal acceleration. I get the turning angle from the nose gear’s angle, and the radius is sorted by length(which is set to 85).
I have three int values, which are for each, radius length and turning.
the formula is:
Radius = length / cos(90* - Turn Angle)
I want to attempt to do this turning realistically, although it goes insane because of the body gyro and body velocity. Is there a way I can take it out and just use the radius turning?
This is my code below. (move is a BodyVelocity, and Gyro is a BodyGyro)
local Radius = script.Radius
local Length = script.Length
local TurningAngle = script.TurningAngle
TurningAngle.Value = Control4
-- Taxi makes the aircraft turn?
Radius.Value = Length.Value / (math.cos(90 - TurningAngle.Value))
move.maxForce = Vector3.new(Radius.Value, 0, Radius.Value)
gyro.maxTorque = Vector3.new(0, Radius.Value, 0)
--move.maxForce = Vector3.new(math.huge,0,math.huge) -- Taxi
--gyro.maxTorque = Vector3.new(0,math.huge,0)
gyro.cframe = CFrame.new(main.Position, m.Hit.p)
end
I’m not sure if this is the only problem but when doing math.cos() it takes in the number as a radian so convert your 90-angle to radians using math.rad()
It still flings the model when I accelerate using the code I’ve given - including the math.rad() part too. It has to do with the bodyvelocity or bodygyro.
Alright, I’ve tried a similar approach to how you’ve said, I have managed to make the aircraft turn but only one direction… with the code of:
local Radius = 4.8
local Length = script.Length.Value
local TurningAngle = script.TurningAngle.Value
TurningAngle = Control4
-- Taxi makes the aircraft turn?
local rad = Length / (math.cos(math.rad(90 - TurningAngle))) / 1000
--Radius = Length / radians
print(-rad)
move.maxForce = Vector3.new(math.huge,0,math.huge) -- Taxi
Angle.maxTorque = Vector3.new(0,math.huge,0)
Angle.AngularVelocity = Vector3.new(0, Radius ,0)
I need to change the “Radius” value around when the mouse is moved left, it should turn left, vice versa for the right. The middle should just take it straight.