Aircraft control surfaces problem.

Hello! I’m trying to get my model working with the aircraft controller from standard assets and I’m stuck with the control surface script. It works alright with the standard aircraft model, but when I try to use it with a different aircraft, the surfaces(elevators, rudders, ailerons) act quite weird. Instead of rotating, they move upwards and downwards.
How can I get it working?
Thank you.
P.S. I had to rotate the model for 90 degrees, but the axis seem alright.
https://pastebin.com/vGKRXegN (the code)

This can be tricky but with the Unity editor you can step and pause and see what is going on pretty easily, see what axis you should be wiggling to get the motion you desire.

The easiest way to approach this is to make sure you have an extra pivot transform precisely oriented the way you want to move the control surface, and then put the control surface as a child of that transform.

Then when you move the pivot around the desired axis, no matter how the geometry for the control surface was made, it will work. It takes a moment to set it up right and pull the bits of your model apart and reparent them with the correct pivot, but once you do that it is saved in the prefab, then you drag references to the pivots into your control surface driver script and it should all work.

Works right as I wanted, thanks

1 Like