GUI Button, doesn't work in World Space

So,

If i’m in "Screen space - Overlay " mode in canvas. Button works.

And if i’m in “World Space”, button does’nt react.

Any idea ? (I tried five time from scratch with almost all the setting I see ><)

Problem Solved :

You have to select a camera, in “Canvas < Render Mode < Event Camera” :slight_smile:

17 Likes

thanks had the same problem!

2 Likes

Thanks was having same problem.

1 Like

Thank you so much Otactu, I’ve been having this problem for weeks now and thought about the RayCaster and button texts and Canvas’s, also backrounds and about the canvas being in the negative in the scale, but this was the problem all along. Thanks much!!!

1 Like

here better tutorial

1 Like

If its not the case also try removing check on Graphic Raycaster > Ingore Reversed Graphics on WorldSpace Canvas which worked for me.

24 Likes

Oh this worked for me! Thanks a lot :smile:

2 Likes

If you still having this issue check if your event camera is in front of your world space canvas. It may be able to see behind because of Clipping Planes parameters.

2 Likes

Totally work for me!!
Thank you very much!!

1 Like

This works for me as well

ALSO → Make sure you do not have a VR headset plugged in!

3 Likes

Thanks . it solved my problem

1 Like

I’m having the same problems but the above solutions does not help. Ive read through and looked at the various unity docs and videos.

The event camera is set and I have tried setting the ignore reversed graphics checkbox. Are there any other considerations i might have missed?

I can’t see anything that might block the camera view and the buttons are visible. Is there a way to debug what the selection ray hits?


edit:
solved it, had another canvas on top of the one I was trying to interact with. It was in screen overlay mode. When going through the scene view and trying to figure out if anything blocked the rays it didn’t show (quite obvious since it was in overlay mode).

11 Likes

The problem for me was that the ARCamera in scene was culling everything except UI. I changed the Layer of the canvas to default and it fixed the problem.

If turning on reverse raycasting worked for you, you probably rotated the world space canvas so that its forward vector it pointing away from the camera. You can fix this by rotating it around so that the green translation gizmo points towards the camera. Turning on reversed raycasting will fix the problem, but you may get weird behavior in more complicated setups!

1 Like

If any of this still isn’t working, try moving the EventHandler so that it isn’t inside the Canvas inside the hierarchy.
Also make sure you’ve got one aswell.

1 Like

That worked for me, thanks!

If all of this still isn’t working for you, try increasing the “Order in Layer” on the Canvas.

2 Likes

Another issue could be colliders blocking the ray. If possible, move the collider behind the UI.

More details here: