Replication PlayerController, pawn

I have a 2 Human PlayerControllers, and 2 AI player controllers.
These playercontrollers all start with a default pawn.

I start a dedicated server and using player 1, I swap the pawn for the AI pawn, Player 1 can’t move.

I take player number two and swap his pawn for an AI pawn, player 2 cannot move, but if I swap back to player two’s deafult pawn he can move.

If I try to swap the AIcontroller to take control of Player one or two’s pawn the game crashes.

I also get this in the log
LogActor:Warning: SetReplicates called on actor ‘AIPawn’ that is not valid for having its role modified.

What is goign on?Maybe I have to activate the pawn’s movement somehow?

Hi Slayeruk,

Are you performing these actions on the server? The first problem I noticed, is if you call SetReplicates as a client, you will get that warning. Your Role needs be be ROLE_Authority (which is normally only ever the server) to call that function.

I have not called SetReplicates anywhere in my code. Only the BP_actors inside the editor have replication set. Could this cause that error message?
I even tured off replicate movement and replicates in the Blueprint and I still get the error.

I also set the pawn and the controller to ROLE_Authority.

Yes I am using a deditcated server.

If I run a non dedicated server I don’t get these error messages and I can move once I swap pawns.

Maybe I am confused about how replication works. sorry

John I fixed my problem, thanks for the help, I failed to call my function on the server. lol sorry for being noob.