[SOLVED] Trying to parent a GO to a spine bone, and it doesn't work

Hello! Help me please solve my problem. I am trying to use this API (spine.get_go)

This is my code

local bone_go = spine.get_go("#spinemodel", hash("rocket_1"))

And I got an error

ERROR:SCRIPT: main/assets/prefabs/rocket/rocket_controller.script:10: the bone 'rocket_1' could not be found in component lobby:/lobby_player/rocket#spinemodel

However, the bone is exists in the spinemodel

Where am I making a mistake?

OMG! I solved it!

For future users with the same problem: don’t forget enable this option

1 Like

This checkbox was added for performance and resource usage reasons. Previously we always created a bunch of game objects, and in very spine heave scenes all of the transform updates of the empty game objects could have a measurable impact on performance.

2 Likes

I think it is a good option, although you can go further and make this option available separately for each bone, enabling it directly in the spine scene file. Since spine animations usually have dozens of bones, but for parenting only one or two are typically used.

However, the more important thing is to mention this option in the API docs
I think it could be phrased like — “Be sure that the option “Create Go Bones” is turned on in your spine model”

If it is possible I can make a PR with this mention to the doc repo

Please do!

1 Like

link to PR
Hope I did it well.

I had that issue before too. More than once. Lol