How to get a controller reference as a client?

Hello everybody,

I’ve already apologized for my poor english, it’s not my first language but I’ll do my best !
So I’ve an issue about networking. I want to create a board game. All my project works when I try to play alone. But when I start to play into a server, all actions don’t work with the client, but work with the server.
For example, when I try to move a pawn (not possessed), I used the event “On clicked” from my pawn actor blueprint. When it’s clicked, it goes with a custom event into my player controller blueprint and with this blueprint, I’ll do all actions which are possible (changing color, movement …). But when I try to make this into a server, it doesn’t work. I try to just make a print to see if it’s working, the message appears, but the client name is weird : Client -2 : Hello ! Whereas all clients are named Client 1 and Client 2, not Client -2. So the event “On Clicked” works but not referring to the right client.

Any idea for my problem?
Thanks in advance !

Hi Rokas30, its hard to say what the problem is without seeing some screenshots. It might be that you are trying to click on the client and not passing the clicked location to the server correctly, don’t know. If you just want a controller reference, why not add them into an array of player controllers on the server when spawning the players (in the Game Mode or the Game Instance).

This PDF (by eXi) is very useful for understanding multiplayer in UE4 . . .link text

Let me know if that helps.

Thanks a lot. The PDF was really helpful ! I finally understood my issue. When I tried to run on server, my variables weren’t implemanted ! They were just implemanted on the owning client.