There a few ways you could do this. You could use viztask's signal and wait functions and send a signal when the collision of those objects occurs within your onCollideBegin function. Then wait for that signal in your task function.
Or you could create a custom event that is generated when those two objects collide and wait for that event in your task function. The docs describe how to create a custom event.
|