Adjusting A* to account for 2D hitbox?

Hello!

I’m currently using A* in a topdown game where my AI’s hitbox is down towards its feet(off center). This is causing my enemy to get caught on walls a lot. Is there a way for me to expand/move the hitbox detected by A* for the AI?

Screenshot included - player is white on the left, enemy on the right. Green hitbox underneath.

Hi

It looks like you are using a lot of smoothing on that path which causes it to pass through obstacles. I’d recommend reducing the amount of smoothing.

Pathfinding always assumes that the character can be represented as a disc on the graph, centered at the character’s pivot point. You can however move the rendered sprite if you wish.

1 Like

Thanks so much for your reply! I adjusted my sprite’s pivot point to by its feet and that helped its movement a lot. I also removed the smoothing and the clipping is gone. Thanks for your help

1 Like