Teams? Multiplayer?

Hey I don’t know if this question has been asked, but I get blueprint replication, how you can replicate variables across that you have created ect. However.How would you create a team for a multiplayer? I understand that, A team just means a group of people, and can’t have friendly fire. So if they are on Team A, then everyone on team a cannot shoot eachother and take damage.

However the tricky part where I would need help in is, If a person connected to a game. Is there any way to acess, the identity of the 2 players, and their blueprints? Like I just want to know a way to identify who is in the game, and be able to say that person is on team A, and the player 1 is on Team b. Anyone have ideas on how a team system could be achieved? Maybe theres just something I’m missing with blueprints, cause i don’t know a lot about networking, Any help is apreciated! :slight_smile:

As far as I know there is nothing (yet) implemented in Blueprint that helps you manage different teams. Whatever they implement in the near future you will always be responsible to write a login system where the player can or have to choose a team to join. You will simply store that team Id inside the player controller and refer to the id whenever you want to deal damage ect.

As Wolfsblut says, this is actually how I proceed. I setup a “login” level where your players choose which teams they want to join. It then stores the result in an Integer directly in your PlayerController.
When you need to register the hit and calculate damages, cast to the Instigator and check if it belongs in the same team, then apply damages.

Hi, it might be a bit outdated but you could take a look at this. Hope it helps!

Okay, Here’s a good question, How do you Physically put it into the player controller? In Blueprints, and access it in another blueprint?

Do you intent to keep us busy? :slight_smile:

Create a custom player controller.
Reference the custom player controller in your Game Mode
Add a Var:Int “TeamId” to it.
Make it editable.
Open any Blueprint
Right Click
Search: Get Player Controller
Cast to Player Controller
Pull out a Wire: Search for Var-Name (or scroll to Variables)
Take the Set Var-Name function

…If you can’t take over from here…start with a single player game first and the many available tutorials :slight_smile:

No nope nope i got it, Thx surr much!

Why you dont send the solution for all with the same problem ?

how do you mean? How do I do that?