edited August 2021 in General Discussion
I have a simple game event using Ork's event system.

It is triggered with a boxcollider2d, first it finds a sprite in the scene which is an unlit torch, I then spawn a prefab on this location with a similar sprite besides it is animated, then I deactive the sprite with of the unlit torch and hereby also the boxcollider2d that is the event trigger, I then activate the animation on the prefab.

I get this error afterwards, saying that a coroutine couldn't be started because the object is inactive, it's referering to the unlit torch sprite the event deactivates.

Two main questions, what coroutine? And how to improve the whole event, it seems very convoluted just to play an animation.

the error msg below.
Coroutine couldn't be started because the the game object 'Test' is inactive!
UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
ORKFramework.Behaviours.EventInteraction:EventEnded ()
ORKFramework.Events.GameEvent:EndEvent ()
ORKFramework.Events.GameEvent:ExecuteNextStep ()
ORKFramework.Events.BaseEvent:StepFinished (int)
ORKFramework.Events.Steps.DebugStep:Execute (ORKFramework.Events.BaseEvent)
ORKFramework.Events.GameEvent:ExecuteNextStep ()
ORKFramework.Events.BaseEvent:StepFinished (int)
ORKFramework.Events.Steps.AutoAnimationEventStep:Execute (ORKFramework.Events.BaseEvent)
ORKFramework.Events.GameEvent:ExecuteNextStep ()
ORKFramework.Events.BaseEvent:StepFinished (int)
ORKFramework.Events.Steps.DebugStep:Execute (ORKFramework.Events.BaseEvent)
ORKFramework.Events.GameEvent:ExecuteNextStep ()
ORKFramework.Events.BaseEvent:StepFinished (int)
ORKFramework.Events.Steps.ActivateObjectStep:Continue (ORKFramework.Events.BaseEvent)
ORKFramework.Events.Steps.ActivateObjectStep:Execute (ORKFramework.Events.BaseEvent)
ORKFramework.Events.GameEvent:ExecuteNextStep ()
ORKFramework.Events.BaseEvent:StepFinished (int)
ORKFramework.Events.Steps.DebugStep:Execute (ORKFramework.Events.BaseEvent)
ORKFramework.Events.GameEvent:ExecuteNextStep ()
ORKFramework.Events.BaseEvent:StepFinished (int)
ORKFramework.Events.Steps.SpawnPrefabStep:Execute (ORKFramework.Events.BaseEvent)
ORKFramework.Events.GameEvent:ExecuteNextStep ()
ORKFramework.Events.BaseEvent:StepFinished (int)
ORKFramework.Events.Steps.DebugStep:Execute (ORKFramework.Events.BaseEvent)
ORKFramework.Events.GameEvent:ExecuteNextStep ()
ORKFramework.Events.BaseEvent:StepFinished (int)
ORKFramework.Events.Steps.SearchObjectsStep:Execute (ORKFramework.Events.BaseEvent)
ORKFramework.Events.GameEvent:ExecuteNextStep ()
ORKFramework.Events.BaseEvent:StepFinished (int)
ORKFramework.Events.Steps.DebugStep:Execute (ORKFramework.Events.BaseEvent)
ORKFramework.Events.GameEvent:ExecuteNextStep ()
ORKFramework.Events.BaseEvent:StartEvent ()
ORKFramework.Events.GameEvent:StartEventSetup ()
ORKFramework.Events.GameEvent:StartEvent (ORKFramework.Events.IEventStarter,object)
ORKFramework.Behaviours.EventInteraction/d__29:MoveNext ()
UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
ORKFramework.Behaviours.EventInteraction:StartEvent (UnityEngine.GameObject)
ORKFramework.Behaviours.BaseInteraction:OnTriggerEnter2D (UnityEngine.Collider2D)
Post edited by HAJFAJV on
  • So I figured out why it's throwing this error, it does it when tries to find the sprite with the boxcollider2d on that triggers the event to begin with, but it has been deactived after running the event the first time so it basically tell you that.
  • Disable Deactivate After Event in the Event Interaction component to prevent the event's game object from being disabled :)

    Coroutines can only run on active game objects.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.