Hello. I’m making a dialogue system for my game, and I wanted to play a sound and then return only when the sound finished playing. I tried replicating what another user answered in a similar post, but I couldn’t create a custom event in my function (I read that I couldn’t). How could I adapt that code, or make it work for my function?
In general, you should structure your dialog system as a state machine with current state, and transition events.
The transition events can of course be implemented in functions.
Somewhat unpopular but correct observation: You should in general never use “Delay.” It feels convenient for many things, but it frequently ends up causing bugs that are hard to debug as your game logic scales up.