So what I want to do is to move a node2d's position up and down couple of pixels constantly at intervals to create a jittering effect. What I have so far is a function "onMove" that gets called every 1 second. Or is there any other way of achieving this effect?
func _ready():
var viewport = get_viewport().get_rect().size
x = viewport.x
y = viewport.y
set_global_pos(Vector2(x/2,y/4))
var timer = Timer.new()
timer.set_timer_process_mode(0)
timer.set_wait_time(1)
timer.connect("timeout", self, "onMove")
add_child(timer)
timer.start()
#Sets frame updates
set_fixed_process(true)
#Sets UI
set_process(true)
#Set inputs
set_process_input(true)
func onMove():
print("here")