Need help with a simple aim lock system

Thanks for the input, Orkney. I did as you said and I think it’s more smooth/manageable now. But unfortunately, the problem remains the same, even if I do check if the array length is greater than 0, the function still returns true when the array of enemies is empty. That said, the player is still locking on an enemy that doesn’t exist either in the scene, the variable (CurrentFocusedEnemy) or in the array.