# Team only marker

**URL:** <https://forums.unrealengine.com/t/team-only-marker/428852>\
**Category:** Multiplayer & Networking\
**Tags:** team, unreal-engine, Multiplayer, UE4, question, Blueprint\
**Created:** [July 6, 2018, 11:22pm UTC](https://forums.unrealengine.com/t/team-only-marker/428852 "2018-07-06T23:22:58Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarisFreimanis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/marisfreimanis/32/623407_2.png) [@MarisFreimanis](https://forums.unrealengine.com/u/MarisFreimanis)\
**Post date:** [July 6, 2018, 11:22pm UTC](https://forums.unrealengine.com/t/team-only-marker/428852/1 "2018-07-06T23:22:58Z")

</div>

Hello.

Any ideas how to make team only marker? Basically some kind of marker, what shows only team members?

---

<div class="post-metadata">

**Author:** ![mightyenigma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mightyenigma](https://forums.unrealengine.com/u/mightyenigma)\
**Post date:** [July 7, 2018, 1:33am UTC](https://forums.unrealengine.com/t/team-only-marker/428852/2 "2018-07-07T01:33:45Z")

</div>

Do you mean an actor which is only visible to cameras owned by playercontrollers which have a team variable set to a certain value?

---

<div class="post-metadata">

**Author:** ![ZazarLaLiche](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZazarLaLiche](https://forums.unrealengine.com/u/ZazarLaLiche)\
**Post date:** [July 7, 2018, 8:48am UTC](https://forums.unrealengine.com/t/team-only-marker/428852/3 "2018-07-07T08:48:39Z")

</div>

If you are talking about something floating above the head of the character telling that it is one of your teammate :

You could use a widget component in your character’s blueprint and place it above your character. And then only display it for the player if they are in the same team (using a tag for instance, you check all the actors and only enable visibility on this widget if the tag is the same as you character’s)

---

<div class="post-metadata">

**Author:** ![MarisFreimanis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/marisfreimanis/32/623407_2.png) [@MarisFreimanis](https://forums.unrealengine.com/u/MarisFreimanis)\
**Post date:** [July 7, 2018, 1:14pm UTC](https://forums.unrealengine.com/t/team-only-marker/428852/4 "2018-07-07T13:14:12Z")

</div>

I can’t figure out how to do it. Basically I set teams trough variables. So I tried different ways to set it up, but so far no success

---

<div class="post-metadata">

**Author:** ![ZazarLaLiche](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZazarLaLiche](https://forums.unrealengine.com/u/ZazarLaLiche)\
**Post date:** [July 7, 2018, 2:20pm UTC](https://forums.unrealengine.com/t/team-only-marker/428852/5 "2018-07-07T14:20:18Z")

</div>

By the way, is it for solo or multiplayer ?

---

<div class="post-metadata">

**Author:** ![MarisFreimanis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/marisfreimanis/32/623407_2.png) [@MarisFreimanis](https://forums.unrealengine.com/u/MarisFreimanis)\
**Post date:** [July 7, 2018, 2:20pm UTC](https://forums.unrealengine.com/t/team-only-marker/428852/6 "2018-07-07T14:20:55Z")

</div>

Multiplayer

---

<div class="post-metadata">

**Author:** ![ZazarLaLiche](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZazarLaLiche](https://forums.unrealengine.com/u/ZazarLaLiche)\
**Post date:** [July 7, 2018, 3:22pm UTC](https://forums.unrealengine.com/t/team-only-marker/428852/7 "2018-07-07T15:22:12Z")

</div>

I got a working system, it’s not the best but it can help you create your own.

First of all I added a Team integet variable in my characters blueprints. I also created a widget only containing an “ally” text. I then created a blueprint called BP\_AllyText just containing a WidgetComponent of the class I just created.

 ![246518-bp-allytext.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/4/e/04e464ab8c510de802890d21b70225a706791d5a.jpeg)

Then on BeginPlay in my character, I check if I’m locally controlled (to avoid having every character spawning widget for everybody), and then get all the characters in my level. For each of them, if their team number is the same as mine, I spawn a BP\_AllyText for each of them and attach it to them (I created a scene component in my character blueprint to have a point to which I could attach it)

 ![246519-beginplayscript.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/9/ca9f5bddcd45e895a3196d134ba8eca32ccf4f07.png)

 ![246521-scenecomponent-fortextposition.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/7/1e7fe45d61d20c705131de7a0544c3f4a61f5a9b.png)

As you can see in the result screenshot, My brown characters are in the same team, all the others are in a different one 🙂  
There you have it ! Of course you probably don’t want to do that on begin play but rather when all the players are connected or something like that, but it should be enough for you to create your own system.

 ![246520-endresult.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/3/3/d33bda2c6e12e13ce7b9b708d9ccdecb0bc1fb5a.jpeg)

---

<div class="post-metadata">

**Author:** ![ZazarLaLiche](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZazarLaLiche](https://forums.unrealengine.com/u/ZazarLaLiche)\
**Post date:** [July 7, 2018, 3:22pm UTC](https://forums.unrealengine.com/t/team-only-marker/428852/8 "2018-07-07T15:22:34Z")

</div>

I have created a new answer with an example solution =)

---

<div class="post-metadata">

**Author:** ![MarisFreimanis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/marisfreimanis/32/623407_2.png) [@MarisFreimanis](https://forums.unrealengine.com/u/MarisFreimanis)\
**Post date:** [July 7, 2018, 4:24pm UTC](https://forums.unrealengine.com/t/team-only-marker/428852/9 "2018-07-07T16:24:45Z")

</div>

Hey. I think it works for me, but for more appropriate answer I need to figure out how to make it work after team select. If I put it as event begin play, it already sets everyone as ally (because starting game everyone is in a team “None”).

---

<div class="post-metadata">

**Author:** ![ZazarLaLiche](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZazarLaLiche](https://forums.unrealengine.com/u/ZazarLaLiche)\
**Post date:** [July 7, 2018, 4:50pm UTC](https://forums.unrealengine.com/t/team-only-marker/428852/10 "2018-07-07T16:50:05Z")

</div>

Yes of course you have to create a system where players are put in a different team and thus update their variable but if you can do that, the system I made should work. I used beginPlay to create the example but you would never do that in the actual game I think =)  
A first step for improvement would be to put the Team variable in the player controller instead of the player I think.  
Anyway if the answer is enough for you, don’t forget to accept it so other people searching for that can see the question as answered =)

---

<div class="post-metadata">

**Author:** ![MarisFreimanis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/marisfreimanis/32/623407_2.png) [@MarisFreimanis](https://forums.unrealengine.com/u/MarisFreimanis)\
**Post date:** [July 8, 2018, 6:41am UTC](https://forums.unrealengine.com/t/team-only-marker/428852/11 "2018-07-08T06:41:12Z")

</div>

Actually I have it in Player Controller. Team variable in Master Character was just for some cosmetic reason.  
Will mark it, when will make it work, doing some testing and can’t really make it work.

---

<div class="post-metadata">

**Author:** ![MarisFreimanis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/marisfreimanis/32/623407_2.png) [@MarisFreimanis](https://forums.unrealengine.com/u/MarisFreimanis)\
**Post date:** [July 9, 2018, 11:03am UTC](https://forums.unrealengine.com/t/team-only-marker/428852/12 "2018-07-09T11:03:58Z")

</div>

Ok. I figure out what is not working how it should.  
Right now its like these:

1. Player 1 joins Blue Team, no widget added to players, because he is only one from Blue Team.
2. Player 2 joins Blue Team, widget added to player 1. So now Player 2 can see Player 1 as his team mate, but for player 1 still no team mates.
3. Player 3 joins Blue Team, widget added to player 1 and 2. Player 3 can see player 1 and player 2 as team mates, player 2 still see only player 1 as team mate, but for player 1 there is not team mates.

Idk. Why I’m getting these kind of results, because as I understand it runs logic every time, when player choose team.

---

<div class="post-metadata">

**Author:** ![ZazarLaLiche](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZazarLaLiche](https://forums.unrealengine.com/u/ZazarLaLiche)\
**Post date:** [July 9, 2018, 12:07pm UTC](https://forums.unrealengine.com/t/team-only-marker/428852/13 "2018-07-09T12:07:39Z")

</div>

I think I see your problem. You should create some event that you will run on every player every time a player connects to the game. This event would do something like : search for the ally, check if they already have a widget, if not, spawn one.

---

<div class="post-metadata">

**Author:** ![SparrowARK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SparrowARK](https://forums.unrealengine.com/u/SparrowARK)\
**Post date:** [October 9, 2023, 4:23pm UTC](https://forums.unrealengine.com/t/team-only-marker/428852/14 "2023-10-09T16:23:54Z")

</div>

This will help :  
[How to Create Team Indicator for Specific Teams in Unreal Engine | No co - YouTube](https://www.youtube.com/watch?v=IJtgKMQAxQs&ab_channel=SparrowARKUEtutorials)
