How to click on 2d ui element?

hello
i have some ui elements (text with image) in player entity (so they follow player).
events are not firing for that elements (tested mousedown, click)
also they cannot be found as event.target from document.mousedown.

are they absolutely invisible for 3d engine?
how to click on them?
near that text and image i have a button, it can be clicked well

thank you

Hi @Dima_Romanchuk,

For any element component to receive input, make sure that Use Input is checked (by default it’s off):

Check this tutorial on UI buttons for more on this:

https://developer.playcanvas.com/en/tutorials/ui-elements-buttons/

2 Likes

thank you, man :kissing_heart:
last hours i spent trying to use constructions with rigid bodies, raycasting and planes :rofl:

2 Likes

Ahaha, been there :innocent:

1 Like