Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does the coroutine from a script stop when i create a new instance of the same script?

Asked by 2 years ago

Hello everyone, I'm pretty new here (and desperate for help) and I would like to ask help on coroutines.

I am currently making a state machine for a AI based off my unity implementation. It has 2 states, both of them inherits from a Module Script called "BaseAIState." In that State, I have a function that is supposed to be a coroutine created and ran by the parent script

but here's the thing: whenever i create a new instance of the parent script, the coroutines i created from the last instance created suddenly stops for no reason. does anyone here have any clue why this happens?

Answer this question