"Get all actors of class" - last index; remove actors from array when they are destroyed?

Hello, in my game players have the capability of dropping out and dropping in. My camera system works by getting the number of players, well actors of the class “player”, and placing the corresponding camera there (camera for one player, two players, three players, and four players). However, let’s say four players join, and then one of them leaves. If he joins again, the array will have a number of 5 instead of 4. Is there a way of deleting a member of an array like that when it is destroyed/on command?

Thank you!

You can listen to the destroyed delegate for the actor and remove it from the array when that happens