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"

Spawning duplicates problem (multiplayer game)

I have a spawning system in my multiplayer game prototype. (I followed this tutorial: https://www.youtube.com/watch?v=3lN2eZIgAQ0∈dex=161&list=PL1mAlSL892EumWuBcRGa6WDW6lQNvlPsk&t=1s)

And in the tutorial he has a problem with duplicates spawning at the same point. His fixes the problem by setting the default pawn class to None. However, when I do this this no player spawns.

3 Spawn points. alt text

2 Online players, but 6 characters spawned.

alt text

GameMode blueprint (spawning players for each spawn point in the world). alt text

But when I set the default pawn class to none... alt text

The player doesn't posses any of the spawned characters.

alt text

Product Version: UE 4.21
Tags:
ue4-help-1.png (1.0 MB)
ue4-help-2.png (1.6 MB)
ue4-help-3.png (447.0 kB)
ue4-help-4.png (135.9 kB)
ue4-help-5.png (1.2 MB)
more ▼

asked Feb 07 '19 at 06:46 PM in Blueprint Scripting

avatar image

JustNatBros
5 1

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

1 answer: sort voted first

Remove the Instigator in your SpawnActorOfClass. Also add Delay of 0.2 before you possess to make sure your pawn has initialized properly enough before posessing it.

What I would do differently is, add PlayerIndex inside your pawn. After spawning it in your GameMode, set your pawn's PlayerIndex. And then on your pawn's BeginPlay, i'll move the CreatePlayer node there and then possess it based on PlayerIndex. That way you dont have to put the Delay node.

more ▼

answered Feb 07 '19 at 10:42 PM

avatar image

Chyros
991 6 3 6

(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