Buttons don't receive click events

Is there an issue with using the UI Canvas?
image.png

Original Post on Discord

by user 553297758795333647

Even this log does get called in the button.ts.

by user 553297758795333647

Hey :wave: since the engine is from a production NPM package, i’m usure if your changes are preserved.

Can you try adding the ?debugbutton to your url and see if the ballon message “CLICKED BUTTON” appears?

Click Button does not appear with debugbutton

by user 553297758795333647

The UI is just not picking up any click events

by user 553297758795333647

Can you open the ScreenSpaceUI sample and test that everything works there?

(You might click “install samples package” if you haven’t done that already)


@Sinful Spartan If that works, can you double check if there are any other components in your scene?
If that sample doesn’t work, can you double check on what version you are on and maybe update the package? (Window/Package Manager)

So the sample scene works with the UI. I tried to add UI to the sandbox. I created a minimal scene and ui works.

by user 553297758795333647

Thank you. I have no idea what the issue was with the sandbox scene.

by user 553297758795333647

Can you check if any of the objects was maybe set to the IgnoreRaycast layer (or RaycastTarget was off in Unity? Or a Canvas group with interactable off?)

I can’t find any difference between my working scene on a fresh minimal vs the default sanbox scene

by user 553297758795333647

All raycast targets are on

by user 553297758795333647

Do you have any sort of raycaster in your scene? graphicrayfaster? Or objectraycaster?

Oh. Wait the game objects are blocking the ui canvas

by user 553297758795333647

Feels backwards

by user 553297758795333647

If its a worldcanvas they can

No it’s an overlay canvas

by user 553297758795333647

by user 553297758795333647

Okay. So yeah 3d objects block screen space canvas.
I tested using the camera screen space and if you set the plane distance far enough it will be blocked by the 3d object for raycast only.

by user 553297758795333647

Okay. So its just he dragcontrols.ts that is causing issues. Since it using the onpointer ui events. Which are the same that the ui elements are listening to.

by user 553297758795333647