Hi @bleakGorilla ,
Parts of the answer have already been given to you by others. I have faced similar issue in my project and soaked-up some learning from the big brains here in this forum.
So, let me share this part with you.
First, you did attempt to set a renderingGroupId to your mesh but obviously, it didn’t work.
The answer is, the BJS 2D GUI (advancedTexture) always renders on top (at least by default).
You have a couple (or more) solutions as a go-around.
One (may be the easiest one) is to bring in a second advancedTexture with a higher layerMask in your scene. You would assign this one to the mesh you want to display on top.
Next, @Blake also gave you an indication of how to handle the problem. By bringing in a second camera in the scene (basically a duplicate of the first cam) and assigning it to use the same layerMask as the mesh(es) you want to show on top (or behind) the GUI and/or other meshes, you can sort the order of how the meshes/meshes groups and the GUI are showing.
So, in short, the features you want to have a look at is multiple cameras and layerMasks. Alternatively to the multiple cams approach, you can also make your GUI in a separate scene. There is some quite comprehensive information in the doc (GUI section and advanced section).
Hope this helps and meanwhile, have a great WE,
Edit: Rather than this long explanation, quickly did set-up a simple PG for you. It’s very rushy, but after all it’s sunday here
One remark: To keep this simple, I have put just basic numbers of 0 to 2 for the layerMasks. However, note that ‘layerMask’ works with hexadecimal. If you fancy it, you can be much more precise in the sorting.
I have pushed new instructions to the left. Again, apologies for this rushy PG. Still, hope this helps you towards understanding the multiple camera and layerMask approach. Again, there are also other ways.
Edit2: LoL, just realized the PG made by @Blake. Well, at least now, you can see some variants of this technique. I should really start reading the text before posting