I have a multiplayer game(with 2 players) and curious how to add an Enum(TeamA) and Enum(TeamB). I know it would be done at Being Play using an Array and Loop, but not sure how its done in Blueprints. Could someone post a blueprint example of adding/inserting an Enum to MyCharacter blueprint so I can setup the 1st Player to be on TeamA and second player on TeamB?
in the content browser, go to new > miscellaneous > enumeration. add a few type identifiers ( TeamA, TeamB,… ), save the enum, then open your MyCharacter blueprint, create a variable called “teamID” and change its type to your custom enumeration. you could set these in the level blueprint using postBeginPlay, or you could set these in your custom game mode.
but an easier way is to just make teamID an integer. that way, you can have some game modes where everyone gets their own team, and some where there is only 2 teams.
Thanks Rama, I have been following a lot of your post on the forums and I greatly appreciate your answer.
I am curious how would you assign the teamA or TeamB to player at begin play? I am using MyCharacter BP for all players, do I simply set “MyTeam” with Random Integer and this will assign a Team to each player?
I understand the switch, but how would one set Player 1 to Team A and Player 2 to Team B.
Then, how does one know which team they are on? So I can setup collisions.
Lastly, for collisions of bullets (where the bullet may hit oneself)… would you use HitEvents or Overlap events?
Thanks for the feedback, That Set Part, is where I get a bit confused, do I just set TeamID one time, and it will set for each player. Do I need to loop this or something? I am unsure how one would set the team ID for each player.
Hope this helps someone, I believe I found a decent solution thus far… on how to do the entire process for setting multiplayer for two players so one can use event hits and know who is getting hit and who is not.