[BUG] The cursor\touch is on object event ignore the shape and size of custom hitbox and rotation of object

It seems like if we edit the hitbox of our object to be smaller or a different shape, the “Cursor\Touch is on object” event ignore this and return true even if the cursor is at any point of the original hitbox which is the full size of the image.
It is also seems to ignore rotation of an object and the condition return true at any point of the original rotation.

It is a problem when you have empty, transparent parts and the object is not a square shape and you don’t want the user to trigger certain events while the mouse is over an empty space but only when the mouse is actually over the object.


GDevelop 5 beta82
Windows 10 64bit

today I ran into this problem. so what shoud I do with it?

At the moment, there is nothing can be done about it I guess. The only thing I can think of right now is maybe check distance between the object and the cursor by taking in to account the size of the object instead of using the event to check if cursor\touch is on object or use a second invisible object as a collision mask with the event.

4ian currently working on improving and optimising collision and distance check that may also going to improve this problem too but no estimate when is it going to be ready:

ok. thank you. if this function is under progress right now, may be he should think about adding a new object tipe, the polygon itself. not as a hitbox marker subordinated of a sprite object, but as an independent object. of course, this only makes sense if the engine is perceive correctly the edges of the polygon. but if that were the case, then there would be no need of that.

Use a custom Mouse Cursor and check collision with it.

1 Like