I have a broken fence that I want the enemies to be able to pathfind through but not the player, is there any way I could do this?
Could different values of the navigation_layers property be used for player and enemies?
https://docs.godotengine.org/en/stable/classes/class_navigation.html#class-navigation-property-navigation-layers
Place an area and script a special event that gets triggered when pressing some interaction key binding that then plays a special animation/mini-curscene for climbing through the fence hole when pressed. On area entered display a non-modal prompt for 'press [keybinding] to climb through' or such then on is_action_pressed('interact') move the character controller into a predetermined position within the bounds of the area so the animation can play perfectly showing the character climbing through and on animation finished you position the character controller on the other side as you want. Could use a key in the animation method track for that last bit determining when the animation ends and to trigger the method placing the character on the other side.
In the above example I'm only considering the player controller but there's no reason this couldn't be made to work for npc's as well, just the player camera wouldn't focus on them climbing through. In effect 2 areas would likely be needed for each side since you likely want it to be passable both ways.
Since by the debug visuals of the navigation mesh you are on Godot 4 use a NavigationLink3D to cover the gap(s) between the navigation meshes for AI where you want movement through the broken fence parts.
© 2022 - 2024 — McMap. All rights reserved.