#UI Buttons don't match their hitbox
1 messages · Page 1 of 1 (latest)
Continue debugging with EventSystem as you were recommended and find out what is blocking raycast
Event system data is on the bottom of its inspector at runtime, you might need to extend it
the weird thing is that nothing seems to be blocking it
Then image border is being overridden. Normaly it just uses image boundaries
Check if Raycast Padding on Image component was changed
Also make sure your canvas boundary actually exists there
image settings for comparison
ok weirdly enough when i altered the anchor transform by pressing shift and clicked on the center middle option, i could now hover over her sprite and it would ALSO light up on hover, while th efeet hitbox remained the same
the sprite looked like this for comparison
Shift I think would center to the current container.
Anchor boundaries should not affect image clickable boundaries
As long as it's inside canvas area
why do you have colliders on UI elements?
Do a simple check to see if it's your button misconfigured. - Create a default button and move it around including into unclickable area.
its for interactions with the inventory system of the point & click game
They are using them in worldspace canvas
i`m using world space canvases
Is that normal? Doesn't Graphic Raycaster work with Graphics just fine without colliders in world space?
Which is another thing why I asked to state what are you actually need them for, because you can do things differently inside canvas.
GraphicRaycaster ignores physics colliders anyway
If you have a PhysicsRaycaster2D then you could detect them with the physics colliders
but if not, the physics colliders will do nothing
I surmised this was needed for draggable things to collide and trigger. Which is again. better ways to do inside UI.
For startes figure this out. If you are not using graphic raycaster on camera colliders would not affect clicking
tried putting the button here, around where an object canvas button is, and while THAT button works (albeit not in the full area and instead in the circled spot, the button i just made does not work or even light up on hover/press
the graphic raycasters are on the canvas objects - should they only be on the camera itself?
I meant to say PhysicsRaycaster2D, those are fine
yeah its there
Silly question btw - do you have more than one camera? And is the camera perspective or orthogonal?
only one camera
It's strange then EventSystem didn't tell you about blocking events.
ortho
oddly enough it seems to be -9 on the Z axis....
and when i put it on 0 it only shows the shadow
for the camera? Yeah it's normal for it to be at -10
oh ok
you need the camera positioned back a bit so it can see the objects that are at 0
So this is why you don't want to mix physics with graphics raycaster with colliders overlapping UI elements.
You should put canvas back to screen space and use only physics raycaster if you want interactable sprites. (Or if you want it to be in UI, use Canvas for everything and remove physics raycaster interactions)
Otherwise you need to track priority which one should be blocking and which one passing events to overlapping elements under it...
ok weirdly enough
i figured out how to fix the issue
... Sort of
it seems to be caused by yarnspinner's dialoguerunner's canvas
which is weird,
because it's an overlay canvas
why is that weird
you would expect the overlay canvas to get first dibs in the event system, since it's always on top
bc the other canvas are in world space
yeah that's working as expected.
and more importantly the dialogue boxes arent immediately active so it just confuses me is all