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"

Casting in Multiplayer

alt textHello. Im trying to make a multiplayer game. I'm using the "Third person character tempate" I'm wondering how I would cast to a seccond client.

Im wanting to get information stored in variables from the second player. for example I'm wanting to get its name as a test. If I set the name of player 2 to "Test Character" and player 1 to "Server character" when I click on the second player the hit resut casts to whichever player clicked so it prints the wrong name. printing "Server character" and not "Test character"

Im still entirely new to Multiplayer Settings as this is my first attempt so if I'm doing somthing entirely wrong here apologies.

![![alt text

Thanks very much in advance for any help.

Product Version: UE 4.16
cast-to-clicked.png (119.3 kB)
more ▼

asked Aug 26 '17 at 02:44 PM in Blueprint Scripting

avatar image

1 1 4 4

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

1 answer: sort voted first


From the EventActorOnClicked, I assume this code is inside the character that is getting clicked? This + get player controller wont work together. The Player controller is not replicated, so there's going to be a mismatch in data.

Instead if you put this code inside your character that you control, your getting your own player controller, and run the event on mouse click or however local event you like. So your using your player controller to get the mouse position and tracing to the other character.

more ▼

answered Aug 26 '17 at 03:50 PM

avatar image

988 17 21 38

avatar image MaxNellist Aug 27 '17 at 04:26 PM

Hello. To clarify this was already on the character being controlled. I have made a small decal on the floor that toggles on and off when clicked to make sure casting is happening correctly and it is.

However the name is still wrong. I have a test system set up for force the client name to either "L" or "P" if you press the corrisponding key. however this string is still not displayed correctly. it appears to work correctly as client 2. But client 1 does not appear to recieve the name string and uses the default instead. alt text

(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