I was trying to upload a video but did not let me sadly
I will try to explain it in two line
after the NPC opened the door the target was behind the door so he got stuck in between,
the thing is you cannot bake the mesh when the door is open because you need the NBC to get blocked by the door and by using the NavigationLink3D you can control opening the door animation and then reassign the target position, so how can I solve this ?
things I have tried:
trying navigation_region_3d.bake_navigation_mesh(true) every door open or closed that’s going to be so heavy and it’s going to cost a lag
obstacles also did not work because basically I need the route of the character to completely changed to avoid the door
Why didn’t the NavigationLink3D work? I don’t think this can be done with only one NavigationRegion3D. You’ll need two regions at least and connect them with a NavigationLink3D or you can also check this documentation page:
after he get to the other side of the link you will re assign the target to the navigation
nav_agent.target_position = target
and by choosing the shortest and the closest path he will get blocked by the door
obstacles won’t help unless there is enough distance
they also won’t recalculate the path even if it is blocking the way unless you repack
and if you are going to repack anyway obstacles are useless
I have already tried them and they did not help
if you know that they actually can fix the problem can you explain more
knowing that I’m not only facing this issue in this specific case ,take it as a large dynamic hallway with multiple doors that can be open and close into both sides, every time and each time the door will open from any of the sides that may block the room from the inside or the corridor from the outside, take it as a real case that might be actually existing in most of the game
If obstacles aren’t enough then you’ll need to manually steer the agent away from the obstacle itself or re-bake the navigation region again with the obstacle affecting it. I don’t think there’s any other option.