How do i make things rotate smoothly?

however when the boss dashes it now looks off since while the boss is lerping to look at me it starts dashing and freezes the lerping and it looks weird

Try @Monday’s code with an else-statement:

if dashing == false:
    # Smooth rotation
    direction = (player.global_position - global_position)
    var targetRotation = direction.angle()
    rotation = lerp_angle(rotation, targetRotation, rotation_speed * delta)
else:
    # Instant rotation
    #direction = (player.global_position - global_position)
    rotation = direction.angle()

Edit: Whoops. Fixed it!

1 Like

With this code when the boss is dashing it’s not even a dash anymore, it just follows the player with a higher speed and constantly looks at the player.

1 Like

Alright it works. Thank you so much for baring with me for so long. Much appreciated!

1 Like