0 votes

I want to make a sequence of events but in my code yield(self,'moveforward_done') doesn't wait the moveforward() execution and starts executing do_event() function again. There is also endless moving car (loop?) because of this. How to fix this code or even make the better implementation of this idea?

signal moveforward_done

func _ready():

func _on_start_btn_pressed():

func do_events():
    for i in right_vbox.get_children():
        if i.name.substr(0,7) == 'movecar':
            if checkb1.pressed and checkb2.pressed:  

func moveforward():
    car1.brake = 0
    car1.engine_force = 40
    yield(get_tree().create_timer(path), "timeout")
    car1.engine_force = 0
    car1.brake = 1
in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.