Set max angle a plane can turn based on joystick input

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By melka24

I would like to make a simple game in which you control a plane with a touch joystick.

I get the input in a normalized Vector2 (for example (-0.5, 1))

Now I would like to steer the plane in the direction of the input but I want to set a maximum angle it can turn.

Also, if the plane is going straight forward (0,1) and I “pull” the joystick all the way down (0,-1), I want the plane to make a big turn and not just change the direction instantly.

Any ideas?

:bust_in_silhouette: Reply From: ramazan

Have you tried clamp?