Moving a game object/sprite to a Spine game object and retaining the z order (SOLVED)

I’m moving a sprite into a Spine model game object with:

go.set_parent( “/helmet#helmet”, helmet_holder )

Which works, but no matter what z value I set, the helmet is drawn behind everything. The holder inside the Spine model is the top layer. What’s up with this?

Hmm, not sure. I haven’t played around with this myself. @sven might know?

Should work as far as I know. What Z-values are you using for the spine model, the helmet, and their game objects?

I’ve played around with many combos, but none of them seem to make any difference. This is what I have now:

  • Spine model go 1: 0.4
    – Spine model go 2: 0
    — Spine model: 0

  • Helmet go: 0.5
    – Helmet sprite: 0

A curious thing is that when I set a z value higher than 0.5 on the helmet it disappears completely.

I obviously hadn’t tried enough combos! This works:

  • Spine model go 1: 0.4
    – Spine model go 2: 0
    — Spine model: 0

  • Helmet go: 0.0
    – Helmet sprite: 0.5

1 Like

It goes outside of the default renderable range of -1 to 1?

0.5 should be groovy still, right?

Not sure about groovy :slight_smile: But keep in mind that in a hierarchy of objects the children inherit their transforms from all ancestors (which in your case means that the final z-value of the helmet will be the sum of z-values of the object itself and all ancestors)

3 Likes

Oh blimey, I hadn’t thought of that. Making a mental note to remember this in future.

2 Likes