The issue is that the pathfinding is calculated on the server and the client can not predict the movement, meaning the character does not move until the server says OK.
An AIController only ever exists on the server. Path finding is only accessible via an AI Controller.
I have it setup as follows:
- GameMode spawns a PlayerController and a Pawn containing nothing other than a camera & spring arm.
- PlayerController tells server to spawn an AIController and the Pawn that everyone actually sees. AIController possesses this pawn.
- PlayerController calls AIController->MoveToLocation() to move the player.
^ However, it gets called on the server, so any latency at all means the player is waiting that long for their character to move.
I noticed in Project Settings -> Navigation System there is an option “Allow Client Side Navigation”, however because the client wont be aware of the AIController I don’t see how it’s meant to use that option.
Ultimately the client needs to predict the pathfinding that the server performs. If anything I’d prefer the pathfinding to be fully client-side and then using something similar to AddMovementInput to move along that path. Possible?