Need help with timer syntax
reddit.com·13w·
Discuss: r/godot

Hey all, I’m making a game where I’m trying to code an animation whenever you click on an object. Specifically, when you click on the object, it will go to the center of your screen, wait a second, then slowly fade out.

For the part where you wait a second, the code is here:

if global_position == Vector2(525,325) && GoAhead == false: #Checks if the object is in the right spot, and if it hasn't done this already
$Sprite2D/Sprite1.self_modulate.a = 0 #Changing from one sprite to   another
$AnimatedSprite2D.self_modulate.a = 1
$Timer.wait_time(1)
GoAhead = true

However, when I run that code, and get to the part where the timer is about to trigger, I get this error message:

E 0:00:01:772    _process: Invalid call. Nonexistent function 'wait_time' in base 'Timer_'

I kno…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help