I would like to create a capture flag area.
I am using a SphereComponent for the collision to delimitate the capture area.
I want to use AActor::GetOverlappingActors to get a list in a TArray of all the players inside the area, to check their quantity, their team, and define which team is capturing and at which speed.
This is common practice to all of this kind of functions. If you have no return function on something that should return something and one of arguments is a reference (&), you need to declare local variable (but it can be declared anywher actullye) of that reference type and pass it to reference like this: