I have point in middle of map of a team game. How do I make hold that point mechanic? So when 1 tema reaches some score game ends. I think of a enter a trigger of the point (Cone right now) and then it starts giving points to 1 team?
UPD Trigger box>give integrals to 1 team(differ teams by tags), show it in UI >End game event when number reaches X
But I dont know how to do it.
One way to do this:
- Create an Actor that contains a trigger box. This is the “point” to control.
- Set up collision for the trigger box to only trigger when Pawns enter.
- Implement some interface on your player character (pawn) that returns which team the player is on. (Call it “red” or “blue”)
- Set up two Set variables in your control point blueprint, “BluePlayers” and “RedPlayers.”
- In On Actor Begin Overlap, call the interface, and see whether the actor belongs to a team. If so, add the actor to the appropriate team set.
- In On Actor End Overlap, remove the actor from both Sets (you don’t need to do the “which team” logic here, because it’s safe to remove something that isn’t in the set, from a set.)
- Add a RedScore and BlueScore variable.
- In Tick, check whether one set is empty and the other is non-empty. In that case, increment to score for that team by the DeltaTime amount.
- If one score reaches your desired win score, declare win!
1 Like
Trying. I also saw in LyraStarterGame theres exactly this. A point which also has very good VFX of capturing process. But I think you cant extract that map.