Startcoroutine outside monobehaviour. But now I can't inherit Monobehaviour. Aug 28,...
Startcoroutine outside monobehaviour. But now I can't inherit Monobehaviour. Aug 28, 2011 · Hello, Is there a way to have a coroutine without deriving from MonoBehaviour and having an instantiated GameObject. // In this example we show how to invoke a coroutine using a string name and stop it. StopCoroutine with a specific method name. For various reasons it is necessary that this class not be a game object and thus it can’t derive from monobehaviour, however I need it to be able to run coroutines. The MonoBehaviour script is destroyed with a call to Object. Mar 18, 2024 · I had multiple places where I needed to start a coroutine from outside a Monobehaviour component. Dec 22, 2022 · 0 I want to use Coroutine in my script. As far as I know, I have to inherit Monobehaviour to use Coroutine. - in the concrete state script 'apple' is a monobehaviour object, which can use StartCoroutine - in your concrete state, create a coroutine function (ex: private IEnumerator CF () ) You must use the same parameter type to stop a coroutine with StopCoroutine as was used to start it with StartCoroutine. rjp pmgrmult qtgey aksr owd vza alrvr rom jykxmnn mqz