Accessed to none trying to read property My Player Reference on the other player

Like this? http://prntscr.com/jyhmca

(I know, i’m very annoying, but I need to do this step by step because I’m new and If I fail in something, the rest of the system would die and I will need to explain more and more)

there is a boolean node called isserver that you can branch on

i am sorry i havent provided screenshots. I am usually not at my computer when i answer these :slight_smile:

I saw your screenshot. That can work if you set your variable to replicate. It will be less confusing if you name the variable something different like PlayerIsOnServer. Sorry I am not sure if this will work but it seems like it should.

also you can save yourseld from having to loop through the gamestate’s player array if you store a reference to the ghost player’s player state after you find it the first time - you can store that in the gamestate and replicate it as well. as a shortcut.

In a networked multiplayer environnement only the server has all the controllers. The client has only his locally controlled controllers. So to put it simply in your context the player 2 don’t have access to the controller of the first player.

How I can do it? Setting a Player Controller 1?

Now I got it working ONLY ON THE CLIENT, because I forgot to set the PlayerState in the World Settings. I didn’t tried yet to do yout method of looping trough all playerstates, because I… I don’t know how to do it lol

No, you have to use something that’s not a Player Controller to store and replicate the information, like a PlayerState for example. That’s one option that can work.

Ok, problem solved :smiley:

Instead of creating a reference to the Player State in event construct (Wich only happens on server, that’s the reason why player 2 can’t detect the reference), I’ve casted directly the PlayerState in the GetText_0, and I got the GhostLife variable.

The problem now is that the server and client variables are unsync, for example if I hit the Ghost on the server will rest 1 of life but in client 2, but seems easy to fix.