2D Change direction with an arc

Hello,

I’m new to C#/Unity but I’m in PHP for 13 years now… not important :slight_smile:
I have made a 2D airplane which is flying forward (right) on X axis, then when I click with mouse
anywhere on screen, I want the plane to go to that target target can be behind airplane or anywhere else…

And I have made that code easily… but the plane changes direction instantly, and I want it to change direction with smooth & curve.

I have found this code here… the demo shows the movement I want (change of direction with small arc)

But I was not able to modify it to c# … :frowning:

Can anyone help me out? Would appreciate it! :slight_smile:
Thanks in advance!

You probably only need to change one line in your code. This must be somewhere in your Update() method so it gets called on every frame.

float new_angle = Mathf.LerpAngle(currentAngle, destinationAngle, Time.deltaTime );

What it does is just changing the angle over time instead of instantly.