I am planning to show an avatar which appears at random places on screen for short time (ta) and disappears after ta, and this process happens at intervals of time (tb), for this, I used spawner and onspawner_timeout( ): where the Wait time is 3 sec where I change the position of avatar to random inside the timer, but this will happen always after 3 sec, I would like to make this wait time shorter after every time the function is called, couldn't find any solution for this, it'll be great if someone knows hoe to solve this - Thank you :)
This is my code at present
extends Sprite
var _avatar = null
var current_pos = get_pos()
var current_pos2x = Vector2(current_pos).x
var current_pos2y = Vector2(current_pos).y
var screen = get_viewport_rect().size
var screen2 = OS.get_window_size())
func _ready():
_avatar = get_node("../avatar")
set_process(true)
func _process():
print(current_pos)
_on_spawner_timeout()
func _on_spawner_timeout( ):
current_pos2x = rand_range(0,Vector2(screen2).x)
current_pos2y = rand_range(0,Vector2(screen2).y)
current_pos = Vector2(current_pos2x,current_pos2y)
print(current_pos2x, " _ " ,current_pos2y)
print(current_pos)
print("spawner is on bro..!!")
set_pos(current_pos)
set_process(false)
pass