So I have the third person example and I wanted to debug print a text to the screen when the game starts (beginplay) - I figured I could use the Is Locally Controller or Is Local XXX and then branch… and if so print.
However I get prints for all connected players and not just mine. why is this? and how can I avoid this - my usage would be checking for the ‘players’ player and wanting to attach something or perform an action on it.
If I’m not mistaken you can just use the get player controller with index 0. It should return your local player’s controller since the client doesn’t know about other player controllers.
Couldn’t quite get your usage. Can you clarify on that and give a little more detail?
Note: The index on the GetPlayerController node is for Local Multiplayer Games. There are different functions for checking how many player controllers are created.
As others have stated the print string runs on all clients because all client’s trigger Event Begin Play. I believe you would see it all gets their own player controller by randomizing the print string Text.
This is generally used for Single Player and COOP (split screen). There’s no way to guarantee the connection order. For example On initial game load the host is typically 0. While all other connections are indexed by On PostLogin order.
During server travel (map change) the index order can change. A connected player can be set to 0 while the host is 1.
Print strings are loaded to each screen regardless of what client called the print.
Player 1 will display Client 1: text to display
Player 2 will display Client 2: text to display
Server will display Server: text to display
A simple example is to set up an input that prints to string the Location vector of the client pressing the input.