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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

"Event Begin Play" fires twice from default pawn class in multiplayer

Setting "Event Begin Play" to print "Hello" will result in Server: Hello, Server: Hello, Client1: Hello, Client1: Hello.

This is from a pawn blueprint I have set to be the default pawn in the game. Turning replication on/off doesn't change anything.

Question: Why does it do that? Is there a way to make it fire only once on each machine?

Bonus question: from the default Player Controller it will print twice on the Server and once on the Client. Why?

Product Version: Not Selected
Tags:
more ▼

asked Apr 20 '15 at 11:37 AM in Blueprint Scripting

avatar image

au.re
21 3 4 6

avatar image Mortusnyte Apr 20 '15 at 06:12 PM

It prints it once for each pawn in the level. Which means it prints it twice on the server's side and twice on the client's side. if you had 3 players it would print it three times. The node doesn't actually fire twice. It's just that you have 2 pawns and they both fire.

As far as the bonus question goes, I think it is because the server has access to all Player Controllers while the clients only see their own Player Controller. But not 100% on that. I know that if you try with more players, the server will print for all the Player Controllers while the Clients only print once so...

avatar image DanzigLucifuge Mar 20 '17 at 07:16 PM

Similar issue. The blueprint on the screen doesn't do anything while I run around with the pawn, even if I set the number of clients to 1. Its like I'm still not possessing the player one pawn. Where is the setting or how do I fix it?

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

5 answers: sort voted first

Self -> Is Locally Controlled -> Branch

more ▼

answered Mar 20 '17 at 03:31 PM

avatar image

Socke81
29 5 5

avatar image WiedmololBool Jun 12 '17 at 08:58 PM

This saved me from going insane.

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

Possible workaround: Use 'do Once'-node right after the 'Begin Play' event:

alt text

more ▼

answered Apr 20 '15 at 11:48 AM

avatar image

spyro
1.7k 106 117 231

avatar image au.re Apr 20 '15 at 12:28 PM

thanks for the quick answer.. however it still gets printed 4 times.. alt text

screenshot (9).png (37.2 kB)
avatar image professorbarba Jun 19 '16 at 03:50 AM

Same problem here. I am following the Endless Runner tutorial and got stuck here: event Begin Play in RunGameMode (second video) is called twice. DoOnce also didn't work.

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

try "get player pawn" with player number = 0. Branch on whether "self" equals player 0 ' pawn. Then print. This should work.

more ▼

answered Jul 12 '16 at 12:44 AM

avatar image

ASDASD ASDAS
1

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

You are playing Multiplayer.

You have 2 Pawns. You have two Machines. Both Pawns execute their code on Both Machines.

This is why you get 4 Hello's.

You can use the "Switch Has Authority" Macro to execute Things on the Server/Clients only

more ▼

answered Jun 13 '17 at 07:39 AM

avatar image

Raildex_
512 18 36 61

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

This happens when Start players as Spectators is enabled in Game Mode

GameMode

more ▼

answered Jan 13 '19 at 02:36 PM

avatar image

GTNardy
1 2 3

(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