How to get the local (my player) player

When testing in the editor… Play In Editor (PIE), anything printed for any player regardless of flow control will be printed to all screens.

If print string worked in packed builds the text would only be printed on screen for those that executed the code. Take my previous post example. In the editor testing (PIE) there’s 2 windows (screens). When client 1 presses the input it prints the vector, but also it prints the vector on client 2. The editor denotes which client/simulation the code command was executed on via the client1, client2, server prefix. In a packaged build it would only print for the client that pressed the input.

So regardless of who executes or where it’s executed it will print on all screens when in PIE.
Begin Play, Construction, Input, tick etc.

With your specific example only the Autonomous Proxy for each client would execute. Sims and Server would be skipped. If you remove the branch, then all proxies for each client would execute and you’d get an odd result in the prints.

For Sims, Player Controller 0 is Null because the server does not replicate controllers.
For the Server, Player Controller 0 is typically the host client.

Say there are 3 players. Youd get 3 Autonomous Proxy prints that look good. Then you’d get 3 Simulated Proxy prints missing display name. And then 3 Server Proxy prints that use client ones controller display name.