Getting player number/index
I have been struggling to make a blueprint graph which could let me access the player's number in a multiplayer LAN RTS game. What I am basically aiming for is a functionality making the actors distinguish which actions are done by which players. For example, a red actor should only listen to a Move Command given by Player 2 and Attack Command given by Player 3, whereas a green actor should only listen to Move Commands from Player 3 and Attack Commands from Player 1. What is the easiest way for the actors' BPs to properly execute such idea?
As I haven't managed to find a straightforward node of doing that I thought of some workarounds which do not work unfortunately.
One supposed solution I tried was to get the
Any other ideas?
asked Feb 10 '15 at 12:34 AM in Blueprint Scripting
Identify player by PlayerControllers
answered Sep 22 '15 at 12:13 AM
what you should do, I believe, is on gamemode -> event post login, create a global variable that increases every time a player logs in.. then insert this id to the playercontroller (Event post login has a controller variable, drag it and set player controller id).. then set this 'global variable' to the player.. so every time you use "get player controller", instead of 0 you will use the global variable stored (as identifier) in the player.
answered Mar 08 '18 at 09:55 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here