0 votes

I want to use a function from another script to do some stuff and I want it to do it before my other stuff but I don't want to connect them because the tree structure that I used

For example, I have a car object and at a junction, I need to know what are the possible direction so that my car can choose randomly, the car will emit a signal to the road object so that the road will generate all the possible direction after that my car will choose randomly, what I'm unsure is that the car will always choose after road generates direction. Is it will always be the case with signal or not?

in Engine by (12 points)

1 Answer

+1 vote

Hi,
the connected function will be called immediatley after the emit_signal call unless you connected the signal flaged as deferred wich would deferre the call to idle time.

https://docs.godotengine.org/de/stable/classes/class_object.html#enum-object-connectflags

by (4,044 points)
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.