This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
–1 vote

extends Area2D
export var road_side = "left"
var timer = "timed"

func _ready() -> void:
position = Vector2(0, 0)

func ifdonkeyentered(body):
queue
free()

func process(delta: float) -> void:
while timer == "timed":
print("test 2")
if Input.isactionpressed("uiselect"):
if road
side == "left":
position += Vector2(3, 0)
roadside = "right"
timer = "timing"
yield(get
tree().createtimer(0.5), "timeout")
timer = "timed"
else: if road
side == "right":
position += Vector2(-3, 0)
roadside = "left"
timer = "timing"
yield(get
tree().create_timer(0.5), "timeout")
timer = "timed"

Godot version 3.5.1
in Engine by (14 points)

Yes, and? Your project may be crashing, but you haven't told us what the error message is, nor how your scene is set up.

1 Answer

+1 vote
Best answer

maybe this is it

while timer == "timed"

that is giving an error you can try to change the while to an if.

by (286 points)
selected by

Thanks, it works!

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 Frequently asked questions and 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 [email protected] with your username.