Steering wheels and joysticks (ingame not input)

I havent been able to work my way around this, although Im sure the answer will be easy enough.

How would I create in game joysticks (for space games) and steering wheels (for cars) that correspond to your movement. So if your ship goes forward you tilt/push the joystick forward. If you turn your car, the steering wheel turns in that direction. Pretty self explanatory.

But you cant really use pre made animations, because its dependant on the amount you steer, with the joystick there can be positions between 2 for diagonals, you get the picture. So how would I handle it.

Thanks guys, Im sure the solution will be simple enough and I’ll come out of this knowing that bit more

p.s. if I dont immediately respond, its because Im just going to bed in a sec, just wanted to make sure I posted this before I do. So dont feel like Im being rude by ignoring perfectly good answers.

You can record positions or rotations for each extreme around your central point. An easy way to do this is to have some extra transforms in your scene, a pair for each axis. Then, depending on the movement, you lerp the position of your displayed object between the pair of extremes for each axis.

So, for a steering wheel, you have an extra transform at it’s left-most rotated position and another at its right-most rotated position. Then, depending on how the car is turning (or, more accurately, where it’s wheels are pointed) you interpolate the transform of the displayed wheel object between the rotation values of those two transforms.