As bruteforce mentioned, the while loop is not needed, and not recommended. You want to work with the delta time provided by the game loop itself.
For your problem, you want to control the speed by time. As an example say you wanted something to rotate 360 degrees over 5 seconds, this is the general idea for achieving that.
var seconds = 5
var rot_d_per_second = 360 / seconds
func _fixed_process(delta):
var angle = get_rotd()
angle += rot_d_per_second * delta
set_rotd(angle)
On a side note, you might want to be careful when doing accumulations on angles. Floating point inaccuracy issues can creep into that.
excuse me i’m trying to achieve the same result with opacity but i don’t understand the concept of the script that you provided. For example i don’t know what delta is. (sorry, i’m new to godot)