(Bug Report) Hitboxes not working properly for sprites that require lots of points

Hey, good morning!
On GDevelop5, when setting the hitbox of a curved object, that needs lots of points, the hitbox in the game don’t reflect what was set on the sprite settings (see included video). Are there any ways to bypass this bug while no fix is available? Is this the intended behavior? Are you planning any fixes for this?

Thanks in advance!

Video: https://i.imgur.com/oIEERXI.mp4

Your link cannot be clicked.
Make sure your hitbox settings doesn’t show a warning. :warning:
I have made a hitbox with +20 points and it worked.

1 Like

I’ve fixed the link
It does show a warning, but other hitboxes also have the “not convex” warning and work okay
Also, there’s no way to make a convex polygon on something curve

I don’t think curves are a problem for making a convex polygon, my +20 points hitbox was a circle.
The problem is the inwards angles at the base of the arrow.
image
Fix the warning and let us know if the bug still occurs.

1 Like

Hmmm the not convex thing seems to be the problem, thanks!
I can’t see how I would do something convex there tho, since the part that the player will stand on is the inner part of a circunference. All angles there are inwards, and I can’t think of a way of making those convex. The problem is indeed fixed if I turn it into convex, but I can’t figure out how to make it convex while keeping it on the arrow’s format.

If you could tell me how you made your curve with convex polygons, I’d appretiate :slight_smile:
Also, is this convex-only thing some kind of thechnical limitation?

I was able to workaround this by using various polygons instead of only one
Being able to use not convex polygons would be a nice thing for future GDevelop versions, if possible

Thank you so much for your help, @Gruk!

2 Likes

You’re right, mine was a full circle, so it was curved but not convex…
Great that you sorted it yourself :+1:

In the source code, I see code that deals with non-convex polygons, so I think it’s possible, but there’s a warning because it will sometimes fail.
This is just an educated guess, though.

2 Likes