How to make the object rotate towards the mouse

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

How to make the object rotate towards the mouse, the object is a KinematicBody2D

:bust_in_silhouette: Reply From: kidscancode

You can use look_at() for this:

look_at(get_global_mouse_position())

Example of usage: