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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Ownership/Role issue on possession switch (player->AI) in networked game

My team and I have encountered a very specific bug that has to do with switching pawn possession with a playercontroller and an AIcontroller in a networked game.

Our case:

During a networked game, we allow a player to be controlling pawn A, and an AI to be controlling pawn B. During gameplay, the player may switch over from possessing pawn A to possessing pawn B. At this point, the AIController that was possessing pawn B will now be possessing pawn A. When testing this during regular single-process PIE as well as non-single process PIE, a bug occurs on Client >1. What I mean by this is that the bug does not manifest on the listen server client, nor does it manifest on Client 1, but Client 2 and Client 3 (which is as far as we have tested this) will see the bug. The normal behavior is that the player will correctly possess the once-AI, and the AI will possess the once-player, and the AI will be moving around according to their defined behavior. The bugged behavior is that the AI will not be moving on the bugged client. All of the other clients will see the AI moving around correctly. If the player were to switch back to their original pawn (which is now the bugged AI pawn) then they would teleport to the correct location according to the server.

Reproduction Steps:

In a clean project, have a level with 4 or more default character pawns. Give the default AIcontroller to one of the pawns, but make sure it moves around in some looping way so you can observe the issue. Write some simple possession-switching logic on a keypress, where the controller that pressed the key will swap possession with the AIcontroller. Then Play in Editor with 3 or more clients, just make sure Clients 2+ are controlling a pawn so that you can test this. As Server or Client 1, try swapping to the AI. You'll notice that it works correctly and the AI is now controlling the pawn that the client was controlling, and it's moving around correctly. Then try the same thing with Client 2, and you will notice that the playercontroller is able to move the newly possessed pawn, but the AI will not be moving in its newly possessed pawn. The other clients will observe everything as normal, just the client that initiated the swap will not.

Some things to note:

If you print the Local Role of the pawns, you will notice that when this bug occurs the pawn that the AI switched to is still printing "AutonomousProxy" when it should be printing "SimulatedProxy".
Additionally, when debugging with Visual Studio attached, I noticed the warning "No owning connection for actor BP_MyCharacter_C_1. Function ServerMoveNoBase will not be processed." To me, this warning explains why the server's authoritative movement of the pawn isn't being respected.

We've been looking through the engine code to try to figure out a workaround. However since it's reproducible in a clean project, we thought it'd be a good idea to post.

Product Version: UE 4.21
more ▼

asked Jan 24 '19 at 11:16 PM in Bug Reports

avatar image

86 5 8 12

avatar image Jeff A ♦♦ STAFF Jan 25 '19 at 02:38 PM


We've recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.



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

0 answers: sort voted first
Be the first one to answer this question
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