Hi everyone, I’m encountering an issue with the Raycast hitboxes on my UI components in Unity. The hitboxes for elements like buttons appear to be offset to the right of their actual position. Has anyone encountered a similar issue or knows how to fix this? Any help would be appreciated!
never had this, does it happen on any element, including default ones?
could this be the case?: Canvas Raycast Hitbox doesn't match Screen Resolution when using Camera with Render Texture
iirc you can visualize the hitbox in the scene view to double-check, but not sure about unity2022, maybe 2023 only has this – and you can adjust the hitbox like you’d do with a collider, I’m just suggesting this to debug it, not as a workaround (though that might work too if you’re in a hurry and the project is small)
The issue occurs with every UI element, as though all raycasts are offset to the right. However, when displaying raycasts for UI elements, there’s no visible indication of this misalignment. I’ve also tried adjusting the resolution, but it had no effect. Since this is a large project, manually shifting each raycast to the left isn’t a viable solution. I’m looking for an alternative fix.
with these global issues I always change the unity version to check if mine is faulty. just do it and check, could save you a lot of time if that’s the issue