Is it possible to remove/discontinue spawn() functions?

Alright so straight to the point,

When you add in a “spawn(function()” code, it basically spawns in the functions but is there a way removing or discontinuing them? it’s not a loop so “break” wouldn’t work either way.

If there’s no other possible way then I believe I will have to use in-script boolean variables, but that could also wreck over the script since it spawns in a function, maybe I’m overthinking I’ll just see what happens if I find no solution for this problem.

This can probably solve your problem:

just use coroutines instead of spawn, they are the better choice for the reason that when using spawn you’ll need to wait for an open slot in the scheduler due to the built-in wait()

1 Like

I have never used coroutines, I might aswell learn about it.

From what I understand, coroutine is in easy words advanced version of spawn() because you can play, pause etc etc, thank you for your help.

1 Like

Thanks you, now, i know how to use them :smile:

no worries mate

1 Like