Use 2D Physics and Collision Testing

Hey there guys. I had a quick question about collision testing and the use 2D physics settings. I’ve been putting together a 4.3 overhead 2D game and and have been having some issues getting any use out of the Height/Length or offset fields on my graph. I am able to get paths and have a simple function to follow them. However they tend to scrape up directly against the objects in my environment causing my characters to get stuck on basically everything.

Is there a way to have the 2D physics system respect the offset value? Am I doing something dreadfully wrong? Is there more information that I could provide to better inform you of the issue. I have tried scaling both the offset and height/length values all over the place. I’ve also varied the grid sizes greatly (between 1 and .1). But nothing seems to get he paths returned from my seeker to stop scraping directly against the edges of most obstacles in my environment.

I went ahead and attached some images of my settings and an illustration of what I am seeing with .1 size grids nodes.


Thanks for the help!

Did you ever solve this? I’m having the same issue, height/length and offset don’t seem to do anything. I tried using Erosion and tagging and it helps a bit but not enough unless I make my characters very small.

The large issue is that the grid is WAY too high resolution for that character.
Increase the node size.

Also, you should switch the “Collider Type” from Ray (which is essentially just a point check) to “Capsule” or “Sphere”, that will enable the “Diameter” field which is the one you want to change.

Ahhh! If I change it to Sphere I can get it to work. I can’t recall if that functioned before. I was (and still am) getting a runtime error that capsule is not valid in 2d. I am assuming this is because there is no 2D capsule collider?

Yes, that is right. Capsules don’t make much sense in 2D (spheres are used as circles).