I’m planning to switch the default movement mode for PCs and NPCs from Walking to NavWalking. I have a few questions, particularly regarding the UCharacterMovementComponent::FindNavFloor
function, which searches the NavMesh up to twice the AgentRadius.
From what I’ve seen in the code, a larger AgentRadius means a wider detection range, so the character is considered to be on the NavMesh even if it strays a bit. Also, the Unreal PhysNavWalking
function pushes to a new position as shown in the following code, making it possible for characters to partially leave the NavMesh. I don’t want characters to exit the NavMesh at all, so I’m seeking advice on any additional settings that might help.
Reducing the AgentRadius significantly prevents exiting but can result in less smooth movement over complex terrain on the NavMesh.
If anyone has experience with NavWalking and knows which settings in RecastNavMesh-Default or CharacterMovement should be adjusted, or how to customize it to ensure movement strictly on the NavMesh, I would appreciate your advice.