Weird behaviour of sphere colliders

Hi there,

I am creating a flight simulation game and have used the AeroplaneController provided by Unity’s basic assets. However, I found that adapting the controller to my own airplanes has caused issues with the wheels, so I switched the WheelCollider components for SphereColliders. This however caused a strange behaviour where the airplane would start slowly rotating on the y-axis only when it is stationary (zero velocity).

wheel-bug

The aircraft is a Cessna and therefore has three wheels, the back one being slightly elevated. Not sure what is causing this strange rotation. The sphere colliders have a Slippery physic material applied.

I also have brakes in this game, implemented by changing the physic material dynamic friction to 0.2. This however causes the airplane (at zero velocity) to jitter and it appears like it is trying to rotate but can’t and moves back and forward very slightly. Any help, ideas or advice would be greatly appreciated!

I have not used the Unity system, don’t know how it works, forces or what.

Just like a real airplane, the issue might be weights and balances.

When you add a collider, the Rigidbody will automatically readjust the center of mass.

You might just need to set the Rigidbody center of mass property at runtime.

If it’s not that, well, time to start debugging the forces involved, see what gives.

If you want a REAL airplane physics controller, check this one out:

I used it in my Pilot Kurt game:

Discussion video:

And here’s a fellow who haxed it up a bit and added flaps and brakes and power control… SO COOL!

His tutorial video:

Thanks for the reply!

I have tried to readjust the Rigidbody center of mass before and that didn’t seem to help but it’s something I can look into again. It looks like I’ll have to debug the specific forces acting upon the airplane.

I have already checked out the GitHub repo for airplane physics and the video that added throttle and flaps was where I got the idea to change the wheels from WheelColliders to SphereColliders!

Solved!

Turns out the AeroplaneController script that I am using from the Unity basic assets was causing issues, specifically in the CalculateAerodynamicEffect. I adjusted the code to only trigger the effect at rigidbody velocities slightly above 0.

Unity’s physics system was working fine after all. Hope this helps someone out!