Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

Product Version: Not Selected
more ▼

asked Apr 11 '14 at 03:46 PM in C++ Programming

avatar image

172 14 19 112

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Apr 11 '14 at 05:05 PM

avatar image slayeruk Apr 11 '14 at 05:21 PM

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

avatar image slayeruk Apr 11 '14 at 06:16 PM

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

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question