Dont dedect Object with 2D Collider

Hello there,

i use A* fpr my 2d Top down RPG. i have big map so i use Node size of 0.2.

But the issue is that some objects will not dedect as collider. when i make collider bigger and rescan then it will dedect.

other problem. in editor i can press the scan button. for script i use astarpath.active.scan();

but this will not rescan my map…

i hope that someone can help me. the asset is very nice but useless with this issue in my project :frowning:

Hi

With the default diameter used in grid graph -> collision testing it will check a circle with the same diameter as the node width. This can lead to it missing very small obstacles right at the corners of nodes. You can increase the diameter setting to 1.41 to ensure that it always finds those very small obstacles in corners as well, though this will also make it more conservative.

I’m not sure why AstarPath.active.Scan() would not recalculate your map… it does exactly the same thing as pressing the Scan button in the editor.

thank you for the fast answer.

where can i change the diameter?

In the grid graph settings. Under the collision testing heading.

But i us Ray because of 2d. diameter is outgreyed

Hi

Well, then it will only check the center of the node.
Which version are you using? It sounds like an old version if it still says ‘Ray’ instead of ‘Point’ in 2D mode. Try to use the circle mode instead (may be called ‘Sphere’ in your older version).

i use version 3.8.10

Oh. That version is several years old. The UI for 2D grid graphs has been significantly improved in later versions. But you should be able to switch to the Sphere mode in your version and it should work fine.

it is working. wow thank you so much. i tried so many thing but never switched from ray to sphere :slight_smile:

ok now i update to latest version. maybe there are also some improvements

yihaaa :slight_smile: