So I put all my objects on separate layers. Land, enemy, power ups, etc. I have all the layers in the order I want. GUI on top and land at the bottom. I also give each layer 15 Z order slots to play with. So nothing on separate layers even share a Z order. Everything looks fine in the work station. I also have all the cameras following the same object. So nothing is out of place when I play. But when I play nothing is as I set it. I have land top tiles that are supposed to be on top of dirt tiles underneath them. The order of everything is all screwed up. And i don’t think it has anything to do with Z order. If I eliminate all the layers and put everything on the base layer withouttouchingthe Z order everything is fine and plays fine.
Just tested and layers are fine in all of my existing projects and a brand new one.
Few basic principles to recap:
- Layers are top to bottom in the layer list. The higher they are in the layer list, the more “in front” they are.
- Placement on layers are INSTANCE specific, not OBJECt specific, and are not automatic (so you have to manually select the layer on each instance you add to the scene, they aren’t applied to the base object)
- Layers each have unique Z orders. No matter how high a Z order of object instance 1 is, if it is on a lower layer than instance 2, instance 2 will ALWAYS be infront of instance 1.
- Each layer has a unique camera. The only way to move the camera for each layer is to target that camera specifically via events, and cannot be targetted in bulk. Leaving camera events’ layer parameter blank will only target the base layer camera, not any other layers.
If you’ve confirmed you dont have any conflicts with the above, then there may be something else going on with your resources, or you may have events that move objects between layers.
You’d have to upload an example project with the issue for anyone to dig further.
I’ll have to get that here in a bit. Basically though, I haven’t used layers this entire project till now. Things were getting cluttered so I just today separated everything up. I had no events that would involve layers. I do have an object following the player and the camera following that object. I moved that object to a layer I plan on hiding. But I have all the layer cameras following that object also. And I understand the order of layers but that’s the thing, an example, I have just dirt tiles only on one layer and have grass tiles only on another. The grass is supposed to drape over the dirt. All dirt tiles are the same Z order, 5, and so are all the grass tiles, 6. And I know this doesn’t even matter when it comes to layers. The grass layer is on top of the dirt layer. So grass should always appear on top. But during play it’s random. Some grass is on top. Other parts have dirt on top. If I delete all the layers everything is fine.
I think it is a bug. There are tiles that are on the bass layer in game that do not appear in the work station. I played through while hiding different layers to troubleshoot. I can’t delete the layer because it’s the bass layer. All I can think to do is delete the dirt tile as an object and reload it back in.
As mentioned, I’ve tested numerous projects and unfortunately can’t reproduce it, so we can’t treat it as a bug unless it can be reproduced.
You would have to upload the project experiencing the issue, or reproduce it in a new project, in order for someone else to test and reconfirm. Once someone else can confirm it we can try to identify tthe source of the issue and/or report it on the GirHub
It’s all good. There were ghost tiles in the bass layer. It somehow was registering tiles during gameplay that were recently moved. They weren’t appearing in the work station but if I hid the bass layer it fixed everything. It was just the dirt tiles. No others were doing it. So I deleted the dirt object which deleted all instances and reloaded it back in. Everything is fine now.