#IPointerClickHandler is not checking the clicks correctly

1 messages · Page 1 of 1 (latest)

gritty phoenix
#

Hi! I am trying to make an inventory system which contains lots of click events. So I am using PointerHandler, when the user clicks on a filled slot it get's the item on cursor

#

but the problem is

#

pointherclickhandler doesn't use(?) the "Ignore Raycast" layer that is on the red object that we have taken from the slot

#

since the red object is right on the cursor, when the player clicks on an empty slot, it doesn't place the object or detect any click on that empty slot

#

how can I make the pointerclick system to ignore the red object which is on the cursor

#

it seems like a canvas-ui problem so had to ask it in here

#

thanks

#

here is the code I am having problem with

#

not the code actually, but the part

#

doesn't trigger OnPointerClick

sharp garnet
#

maybe make the object click and drag and have it snap into position?

sharp garnet
#

make the object move with the mouse when you click and and when the player releases the mouse button it either snaps into a position or goes back if it doesn't snap to anything

gritty phoenix
#

thanks for the answer! I used the quick solution, just added some stuff to the cursor following script so the item icon won't collide with cursor