How do I access the players in an array and call take damage on all of them

// create tarray for hit results
TArray OutHits;

    // start sphere trace
    if (GetWorld()->SweepMultiByChannel(OutHits, SweepStart, SweepEnd, FQuat::Identity, ECC_CustomCharacterCollisionChannel, MyColSphere))
	{
		// loop through TArray
		for (auto& Hit : OutHits)
		{
             // how do I access the players in the array and then call take damage on all of them
		}
	}

Or even how would I call function on players inside the array

Hey,

Afaik OutHits contains weak pointer to an actor. So you should be able to Hit.Actor.Get() and cast or reach whatever you want from there. I am not sure how you set up your “player” class but having an actor should be a good start :slight_smile:

Or you can just apply radial damage