Why can't I add a Delay Node to a function?

Howdy Arthur,

Thank you for responding to this issue. I reached for additional information and here is a bit of the information that I got back:

This feature is a design constraint that will not be changed. The reason is that functions have return values, and can be called from native code. Because things can be relying on the return value of a function, we don’t want to break the game thread waiting for that code to finish delaying.

Event Graph has shared state, and is re-entrant. That allows a degree of flexibility, because we’re saying nothing depends on the result of anything. That’s why events don’t have return values, and allow for delays and other latent functions.

In short, the contract is: if you have a return value, then someone is depending on your code to return as fast as possible, so no delays. If you’re an event, you don’t have a return value, so you’re free to do what you want.

Thanks and have a great day!

3 Likes