I am using the navigaiton system for a 2D project. I was able to do what I wanted by looking at videos on the internet. My character reaches the point I want by following the areas I specify.
But here’s the problem; When I add a new obstacle to the path of the character who will move in the game, it does not see what I add as an obstacle. I think the “NavigationObstacle2D” node is used for this.
As far as I understand, I am drawing a certain area in the obstacle object, and if it is within the area I have drawn with a “NavigationRegion2D”, the “NavigationAgent2D” object needs to go around this obstacle in order to follow the road. This is exactly what I want, but it does not see the obstacles object at all and continues to pass through it. Indeed, this obstacle system has the least information I could find about Godot on the internet. I almost couldn’t find anything explaining the system and how it works. Even after my own tinkering, the problem still persists. If there is anyone who has worked on this before, I would like them to help.
NavigationObstacles do not change or influence the pathfinding in any way. NavigationObstacles only affect the avoidance velocities of agents controlled by avoidance.
Yes, I read in a few places that this is how it is used, but it is not true. I think I need to recreate the path for each obstacle every time, so are there resources on how to do this?
Thanks, it really worked. When I added the newly added object as a child of the NavigationRegion and triggered the BakeNavigationPolygon again, everything was as I wanted. Thanks a lot.