World Space Canvas not working reliable with Character Controller

shirohige

New member
Hi,

I have a world space canvas which doesn't reliably register click events. I have this bug since introducing the character controller into my project, maybe it's the camera controller?

I'm using it together with Cinemachine.

I attached a video showing the broken raycasting.

Please take a look at "pointerEnter" in the lower right corner. When not moving the mouse, this should not flicker like that.

 
The character controller doesn't intercept raycast events so it's likely something else causing it. Maybe your UI elements do not respond to raycasts?
 
The UI has no problems as soon as I disable the Camera Controller.

I meant that I think that it causes this indirectly by influencing the position of the camera. I still have no understanding what exactly moves the camera itself.

This problem of only sometimes registering the events seems to me like a timing mismatch between Update and FixedUpdate, could it be?

Edit: It also works perfect if I remove everything that is cinemachine related, so it's some issue between the Camera Controller and Cinemachine.
 
Last edited:
That's a weird one, never seen that happen before. Like Justin said, there's nothing in CameraController that would intercept raycasts at all, but Cinemachine I'm not familiar with so not sure about that. Also not sure why the position of the camera being controlled would interfere with the EventSystem like that.

Do you have any other UCC/Cinemachine UI layer stuff getting enabled that might be intercepting raycasts? It might also be worth checking if there's a way to debug EventSystem raycasts.
 
No, as I said, the raycasting works fine when disabling the Camera Controller. I just noticed that I won't need the Camera Controller and the world space canvas at the same time, so as a workaround I'm going to disable the Camera Controller when I use the canvas. Indeed a weird one.
 
Top