Instance could not be found error

And hi again :))

Have this error
"ERROR:GAMEOBJECT: Instance '/root' could not be found when dispatching message 'spine_play_animation' sent from main_map:/go#script"
and really doesn’t have any assumptions why it’s appear.
Have a go and spine inside. Error appears when animation starts. Could you please give some advices where to go here?
Thanks!

So, your script sends a message, to a url that doesn’t exist.

Show us the code in that script, and also the object hierarchy in the collection the objects exist in, and perhaps we can help you figure it out.

1 Like

If the script and spine component is on the same game object (which it sounds like the case is here) you can simplify the call to spin.play_anim() to use relative addressing. Relative addressing is less likely to go wrong and it is preferred when manipulating components on the same game object.

spine.play_anim("#your_spine_component_id", ...)
1 Like

Thanks for answer!

The point is I already play animation by spine.play_anim() :frowning:
spine.play_anim("/glow#glow_craft", "GlowElements", go.PLAYBACK_LOOP_PINGPONG)

Inside script I use:
spine.play_anim("/glow#glow_craft", "GlowElements", go.PLAYBACK_LOOP_PINGPONG)
to start animation and
luax.msg.safe_post(self.ItemsCollection[index].glow_go, "disable")
to stop it.

And object hierarchy here:

I don’t see the script in the hierarchy… my fault?

The script separate, it’s not a part of collection. Don’t know why… But it was created before me.

You have to properly address the glow\glow_craft from outside the collection.

There are many ways to solve this. I would prefer to add a small script to the collection (to root) and send some messages to it in order to interact with the collection, for example “start_glow_animation”, “stop_glow_animation”.

In the on_message function in the collection script you may simply do

if message_id == hash(“start_glow_animation”) then
spine.play_anim(“glow#glow_craft”, “GlowElements”, go.PLAYBACK_LOOP_PINGPONG)

and so on.

Moreover, the collection may need some initialization (for graphics or for some related data) and the init function in this script is perfect for this aim.

Hope this help.

Ciao!