Guards gets stuck in furniture

I noticesd that when guards are colliding with furniture on their way to a destination, they get stuck.

stuck guard

How do I make them treat the furniture as walls, so I can use is_on_wall() function?
Or do you have a better solution to make the guards walk around the furniture?
Thanks in advenced! :slightly_smiling_face:

Hi Dror,

In which course are you?

Udemy’s Discovering Godot: Make Video Games in Python-like GDScript,
Section 4: Heist Meisters 3.1 - Top
down Stealth.
(sorry, I’m still not sure where to ask my questions :sweat_smile:)
and yeah, I’m still stuck with the same question…

Don’t worry. I’ve just moved your thread to the correct subforum. It was in the Unity forum. :slight_smile:

ok, i sort of have a workaround if by getting stuck?

if the player is getting stuck on the corners of the obstacles, i think its down to how simple_path works.
since its a single line, that line gets really close to the corner of the nav area, but the player isnt 1 pixel wide and so it gets stuck.

the way i worked around it was to give each tile a navigation shape like the following. and setting the snap size to 8px

that way, when it comes to any corner, theres enough of a space between the nav poly shape and any obstacle colliders to allow for guards to get round it smoothly.
image

did you manage to get a workable solution?

heres a copy of my github repo for this project which includes a custom navmesh for avoiding furnature etc.

hope you found a solution, but if not, hopefully this might give a few ideas on alternatives and we can open a new thread if you didnt find a solution.

https://github.com/oboshape-godot/4-Heist-Meisters-3.2

Privacy & Terms