Trigger Custom event after any "Wait" Unit gives coroutine error

YakDogGames 3 years ago updated by Nikita 3 years ago 9


I'm trying to trigger an event after the end of the frame "Wait End of Frame" and I get an error saying:

InvalidOperationException: Port 'enter' on 'WaitForSecondsUnit#4a86c...' can only be triggered in a coroutine.

And this is the screenshot for the flow:

Am I doing something totally wrong here?


Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

Is the receiving custom event also marked as a coroutine?

I don't think so... Should it be? Didn't see any of that in the docs. I can try tho. But you think it matters?

Yep!  In this case, the custom event is almost a new event, so it is the one that needs the coroutine toggle.


Indeed, if on the receiving end, your event needs to use coroutine units, it needs to be marked as a coroutine too. Flow is not shared across events, it's a new flow entirely.

Don't understand your statement. The receiving end doesn't need coroutines... are you saying that because the sending part is in a coroutine hence the receiving end should be also? 


Ah, but it does need coroutines, as wait units require coroutines to execute.  The error here is because of the after the receiving Custom Event unit, and that event needs to be marked as a coroutine.  (here, your End of Frame needs it too, so you need to keep the On Enable a coroutine too)

How do you mark units as a coroutine? is there an option or something? Sorry, i'm new to Bolt


hidden bool :0)