How to create hitboxes for objects?

Hello, I have a problem, there is an object and I want to set a rectangle hitbox for it, respectively, it should be tied to the object not in the center, but with an offset. I know that you can create a polygonal body, that is, you need a table with X and Y coordinates for each point. But I can’t tell by eye at which point of the object I need to specifically make a point. So my question is, is there a way to visually create a polygonal body for an object? I used the PhysicsEditor program, but it results in a lua file where there is no coordinate table as such. Also, I would like to somehow see the hitbox itself that is being created. I can create a shape on top of the old body, but suddenly there is a plugin of some kind. I will be very grateful for your help.

You can use physics.setDrawMode( "hybrid" ) to see the physics shapes alongside with your regular images, see:

For offset rectangular bodies, see:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.