Spawning AI on client only?

I’d like to spawn crowd of actors that runs away from player location. They are purely cosmetic and have no impact on the game whatsoever.
Is it possible to do that with dedicated server on? From my experiments all the navigation stuff executes only on server and even if it wouldn’t it requires AI controller as input which doesn’t exist on local client. Tried manually spawning controller but possess executes only on server…
Any ideas? Replicating 30 actors for cosmetic reasons puts me off.

Great success!
At least for navigation part, will see how it goes with behavior trees.

Enable “Allow Client side navigation” in project settings. (otherwise SimpleMoveToLocation fails because MainNavData is null)
Disable auto possess and replication on pawn since controller would exist only on server side anyways.
Spawn pawn, spawn AI controller and call possess on it, that way controller is not null on client side.
Pawn->SimpleMoveToLocation, off you go!

2 Likes

Yes if the Client Spawns the Pawn it will not be replicated and can be handled by the client locally. If the Host is also a client (listen server) the Pawn should not be set to “Replicate” or it would try to spawn it on other clients too.