How to spin a sprite in one direction indefinitly

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

i want a sprite to keep spinning in one direction

:bust_in_silhouette: Reply From: Zylann

You can use a simple script:

extends Sprite

func _process(delta):
	
	# Note: put a minus sign to spin in the opposite direction
	var degrees_per_second = 360.0

	rotate(delta * deg2rad(degrees_per_second))

You can also use an AnimationPlayer and animate the sprite’s rotation with a looping animation.