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"

How do I get the current player's "player controller" (multiplayer respawn setup)?


I'm trying to create a simple respawn mechanic in my multiplayer shooter project. When a player gets shot, his life is decremented and when it reaches zero, he dies. This part works. Immediately after his death he's supposed to respawn. This is the part I'm struggling with. This is my setup:

alt text

As you can see, I'm spawning a new character at a preset location (where he's not colliding with anything), then destroy the actor he's currently controlling and immediately possess the new one. The setup above "works", but only for the player, whose index is 0 (in my case - the client). If I change the value to 1 it only works for a different player, obviously (this time, the server). As you can see from the image, I was trying a few different ways to get the player controller (get owning player controller, get instigator controller, get controller), but none of them work. I don't really understand the difference between them, so I just experimented. I don't have much experience with player controllers.

Does anyone have an idea how to approach this problem? I would be very thankful for an answer!

Product Version: Not Selected
bez tytułu.png (365.4 kB)
more ▼

asked May 05 '15 at 03:06 PM in Blueprint Scripting

avatar image

85 14 16 95

avatar image Detech May 05 '15 at 04:05 PM

Event "Any Damage" fire on server's pawn (character). So when pawn got event - pawn destroy self... aaaaaand.... are u sure next code will be execute on pawn marked "Must be deleted"?

I think u can try this: 1. After any damage fire 2. Get pawn controller (Get Controller (pawn)) 3. Call function like "respawn pawn" on controller

Respawn pawn function: 1. Destroy possessed pawn 2. Spawn new 3. Possess new

avatar image Bproof May 06 '15 at 08:00 AM

Thank you so much :D ! Your suggestions helped me to make it work! It took me a while to understand what you mean, but I finally found the solution:

alt text

You would not believe how happy I was to see both the characters to be able to spawn! Thank you :)

a.png (187.3 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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