Implementing Centripetal Acceleration into a Planekit

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
1 Like

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()

image

yeah, math

So how could this be done?

Like this?

math.cos(math.rad(90 - TurningAngle.Value))

yes that will convert it [limit]

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.

I have tried, to change some values this is what I have. This still doesn’t work.

				Radius = Length / (math.cos(math.rad(90 - TurningAngle)))
				move.maxForce = Vector3.new(Radius, 0, Radius)
				gyro.maxTorque = Vector3.new(0, Radius, 0)
				--move.maxForce = Vector3.new(math.huge,0,math.huge)	-- Taxi
				--gyro.maxTorque = Vector3.new(0,math.huge,0)
				gyro.CFrame = CFrame.new(m.Hit*Vector3.new(0,0,math.rad(Radius)), m.Hit.p)

I have used this as the reference for this:

I ended up using radius as a given constant and used the centripetal force to calculate the angular velocity.

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.

I also have achieved turning although It isn’t the turning I would want, as it just feels like the same as what it was before.

I believe this is now, complete I have solved it using angular velocity and modifying each value correctly.

You’re literally overcomplicating it but I guess just use it.