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"

Teleportation in multiplayer? How to target players?

Alright, so I'm creating a multiplayer game and I need to be able to teleport the player using a UMG button. When the player clicks the "Return Home" button in the menu, they should teleport back to their home location.

It currently works fine for player 0 (the server) but it does not work for any of the clients. The clients simple respawn at one of the default player starts instead of teleporting to the specified location like the server does.

How can I target the correct player pawn? How should I setup teleportation in multiplayer?

Thanks!

Product Version: UE 4.12
Tags:
more ▼

asked Sep 30 '16 at 09:30 PM in Blueprint Scripting

avatar image

KenBrace
31 3 9 10

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

1 answer: sort voted first

So I found a solution to this.

  1. Create an event on the player controller called "ReturnHome".

  2. Set the event replication to "Execute on server".

  3. Add an input to the event called "PlayerID".

  4. Use that player ID when calling the "Set Actor Location" function to target the correct "Get Player Pawn" ID.

  5. In the widget blueprint, cast to "ThirdPersonPlayer" and call the "ReturnHome" event while feeding in the player ID.

This way the client or server will tell the server to execute the event with the specified player ID.

more ▼

answered Sep 30 '16 at 11:30 PM

avatar image

KenBrace
31 3 9 10

(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