x

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"

Network: issue on player controlled Pawn

Hi, I set up a very basic game with the following BP assets:

-TEST_GameMode_Multi: default gamemode settings except for Pawn class set to TEST_Pawn_Multi and player controller set to TEST_PC_Multi.

-TEST_Pawn_Multi: just a camera and a sphere mesh.

-TEST_PC_Multi: handles the inputs and make the pawn moving.

Everything works fine but when launching the game in editor with more than one player, only the server player is actually able to move and I get this error message: "Error Accessed None 'ControlledPawn' from node Set ControlledPawn in blueprint TEST_PC_Multi"

I guess the client PC is not able to get his Pawn at the beginning of the game, because the debug Blueprint flow shows that the client PC is getting the inputs. The pawn simply seems not receiving requests from the PC.

Any idea about what am I doing wrong?

Here the PC blueprint: alt text

Product Version: Not Selected
Tags:
test_pc_multi.jpg (259.4 kB)
more ▼

asked Apr 08 '15 at 09:25 PM in Blueprint Scripting

avatar image

LimasseFive
66 5 6 14

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hello. First I don't get what you're trying to achieve with your wast and set control pawn.
But it may not be the main problem here. Actually, the location and movement of a pawn are not replicated over the network. Only the character pawn and its omnious character movement component have this feature. So even if you replicate a pawn, you don't replicate its properties, like position, rotation and so on.
The brute force way to achieve this, is to set a tick event that sends the pawn transform over the network through replicated custom event. Yeah, that's as bad as it sounds. Are you sure you can't live with a character pawn ?
That was my understanding of your situation anyway.

more ▼

answered Apr 08 '15 at 09:46 PM

avatar image

killfassil
91 2 5 9

avatar image LimasseFive Apr 08 '15 at 11:19 PM

Actually there is no need for Pawn replication, the Pawn is just a camera and each player has a PlayerController which should allow to control its own Pawn locally. Now the problem is the client player can't accede his pawn, it works only for the server player.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

You mean that the controller doesn't possess the pawn ? It happened to me already, and I added a little bit of a hacky script : On begin play, I started to check if the controller had a controlled pawn. If not, I created one and possessed it.
I noticed that sometimes the controller connects, and there's not even a default pawn ready. Maybe you have the same issue.

more ▼

answered Apr 08 '15 at 11:28 PM

avatar image

killfassil
91 2 5 9

avatar image killfassil Apr 08 '15 at 11:34 PM

I realize my answer may be confusing. I have to precise that a controller without a possessed pawn is just a floating camera with absolutely no control whatsoever. Looks like your symptoms right ?

avatar image killfassil Apr 08 '15 at 11:37 PM

And I forgot something else (man I'm tired). The issue of the pawn not being fully initialized when you try to possess it, therefore making possession impossible, will porbably happen to if you spawn the pawn and try to possess it immediately. That's how I found out about this problem. So you may want to add a delay between pawn spawn and possession by the controller. And This time I think I said everything.

avatar image LimasseFive Apr 09 '15 at 11:37 AM

I tried this (using a blueprint similar as the one in the ShootOut example): gameMode destroys the pawn and spawn a new one then makes the PC possess it but no better result (even with a delay before possess node). Still no control and still error message "Accessed None 'ControlledPawn' ".

And why should this be needed? The PC is supposed to automatically possess the pawn isn't it? This is what happen for the player on the server or on single player mode...

avatar image LimasseFive Apr 09 '15 at 03:28 PM

Ok, a delay just before the Cast To node indeed seems to fix partially the issue. But it's clearly a dirty workaround, is there not a cleaner way to do it?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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