How to add setGlobalZOrder for two sprites of two different parent node in cocos creator

I’m facing overlapping between two prefabs where both the prefabs have different parent node.
I need to change the z index dynamically throughout the game play.
How do i need to add the code here and setGlobalzindex is not working in cocos creator here.

Any other approach ??

Thank you

1 Like

@slackmoehrle @pandamicro
Pls provide some solution here.

I have been using cocos creator about 3 year from version 1.xx and tried using function setGlobalzindex . It’s not working but don’t know why it exist in the api list (now removed) :slight_smile:.
Cocos renderer just render nodes by it’s order in scene node tree (from top to bot) https://docs.cocos.com/creator/manual/en/content-workflow/node-tree.html. In your particular case, just change your node tree design to solve your problem. Hope this help :slight_smile: