Answered How to make UIButtons display on the top like GameUI?

BlackPolarBear

New member
Messages
14
Reactions
2
Points
3
I locked a UIButton on my CenterEye, but sometimes UIButton is obscured by other objects. So is there a method or plugin to achieve the display priority of the GameUI?
Thanks in advance!
 
You can change the render queue position in the material shader:
 
Upvote 0
You can change the render queue position in the material shader:
Thanks for your answer! Unfortunately, this method has no effect on UIButtons, no matter what the value of the render queue is, it will be obscured by other objects (the wall in the picture).
Snipaste_2023-02-08_11-17-52.jpg

Snipaste_2023-02-08_11-18-15.jpg
 
Upvote 0
Probably more complex than you are looking for, but you could look at my Benchmark scene to see how the UI is made there. It's imported from an AssetBundle with custom-plugins connecting the it's button. The FPS display is always in front and always aligned with the player head.

 
Upvote 0
Probably more complex than you are looking for, but you could look at my Benchmark scene to see how the UI is made there. It's imported from an AssetBundle with custom-plugins connecting the it's button. The FPS display is always in front and always aligned with the player head.

Thanks, but it's a little difficult for me. I think I should change my mind. Since the parameters of the UIButton cannot be modified, I will try other aspects.
 
Upvote 0
You can change the render queue position in the material shader:
Probably more complex than you are looking for, but you could look at my Benchmark scene to see how the UI is made there. It's imported from an AssetBundle with custom-plugins connecting the it's button. The FPS display is always in front and always aligned with the player head.

I think I may have solved it, albeit with a little flaw.
At first I tried to shrink the CanvasXY and get close to it, but the button resolution will be very low.
Later I found out that I could shrink the button as a whole and keep the resolution the same!
I scaled the button down to 0.025 and got close to CenterEye and it worked great!
But I have to hide the buttons or the gizmos will take up a quarter of my screen. 🤣

Still thank you both for your answers and for helping me! ❤
1.jpg

2.jpg
 
Upvote 0
Back
Top Bottom