I am trying to put the white description box in a layer on top of the orange cude model, so that the white description box is on top and doesn’t collide with the model.
I am fairly new in Playcanvas, any help either in code or in the scene option is appreciated.
Layers determine the order that draw calls are submitted in. However, they don’t override features such as the depth buffer which determines exactly which pixels are drawn.
Are you using a Screen and Element components with a 2D screen this will work by default as they are in the UI layer and have depthTest disabled.
If you wish to do this without using the 2D screen, set depthTest=false on your material manually.
@dave
Unfortunately, i have already tested the Screen component, but the behavior wasn’t to my liking.
In general, the white panel looks at the camera, so making it part of a screen removes the nice rotation with the look at.
So i tried the depthtest, but this is still not really what i am looking for. The text and purple box also collide with the model. Is there another method?
Can you link to something that shows the end effect you are looking for? It will help in providing a solution for your needs. If you have a link to the project as well, that would really help.
Here is a video of of the project (well gif, mp4 are not supported on the forum), after 6 sec at the end, it<s the part that I want to fix
Here is the project link: https://playcanvas.com/project/601287/settings
If you used software like Unity, it’s similar. If you want it on top of everything (render always on top and visible at all times in the camera), you parent your UI in a Screen. the Screen has ratio and size of your game resolution. if you put a UI element like a text in the top right of the screen, that text always be visible in the top right in your in game screen and will always be in the same position.
I had to do use a second camera to render the annotations on top of ‘world’ as I couldn’t find a straightforward way to set both text and image elements to not test against the depth buffer.
Hi, I was trying to do something similar(I’m trying to make gizmos), but when I disable depthTest and depthWrite on the material, it gets displayed behind every other entity even though it is infront of it. I wanted the opposite effect where it is displayed infront of every entity even if it is behind it.