Casting in Multiplayer

Hello. 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.

211210-

Thanks very much in advance for any help.

Hey,

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.

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.

Is there any others way’s to cast my Multiplayer Gameplay without using any third party app or hardware?

Bitlife Mod APK | Bitlife App