Local Mutiplayer - Index/refrence
I am creating a local multiplayer game in which players can play split screen using one PC/Console with multiple controllers for different players. (Xbox 360)
So far I have a Game Mode BP which i have created players and them possessed that player using the player character index of 0 & 1 as shown below. This works fine for spawning 2 characters that control separate on different controllers. from this I've tried to make a variable that sets in different characters using "Character ID" as reference to which player it is.
I am then referencing this variable in the character's and other Bp's to reference different controllers and there corresponding pawn/character. Below i am trying to use the ID number to set up different colors for different players eg. Player 1 = green Player 2 = Blue and so forth.
Please help me if i am creating/ referencing players wrongly. I am new to setting up multiplayer and need help on how start creating referencing for local multiplayer.
Many Thanks Harrison Lee
asked Sep 02 '16 at 12:17 PM in Blueprint Scripting
Engine creates 1 player out of the box so by calling "Create Player" you are creating 2nd and 3rd player, so there is already player with id 0. By looking on engine code:
If you input ID 0 that already exist the creation of player would fail and you would get error in logs. Try using Set PlayerControler ID insted which has code that swaps IDs between them, but keep in mind you still gonna have extra PlayerController.
Note that you don't need to use ID system if you have static number of players, you can just keep them in variables.
answered Feb 11 '18 at 12:20 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here