0 votes

Is there a way to call yield in c++? i tried to include both of GDScript.hpp and GDScriptFunctionState.hpp but it seems they both don't implement this method.

asked Jun 8 in Engine by soulldev (44 points)

1 Answer

0 votes

I tried utilizing yield() and it works just fine for me.

yield() should be included as a native part of c++, not any particular part of GDScript. I simply included the <thread> library in my cpp code and was able to use it.

Alternatively, I'm not sure which compiler you are using, but your settings might be wrong. I am using g++-7 on linux, thus requiring the thread library to do my build (-lpthread option). I can also cross-compile this properly for windows using mingw with the pthread lib for mingw installed.

What error message are you receiving when trying to use yield()?

answered Jun 8 by Chekr (22 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.