Ive got a For loop that calls a GEngine->AddOnScreenDebugMessage() that displays each EffectActors’ lifespan, It starts at 0.5(as set by EffectDuration) then counts down to 0.0. But the EffectActors with 0.0 are never destroyed and the Array just keeps growing.
Is there something I need to do to tell the actor to destroy itself when LifeSpan reaches 0.0?
EDIT:
Turns out the issue was not that the EffectActors Actor was not being destroyed.
The issue was that even though the EffectActors Actor was destroyed, it was still somehow in the EffectActors Array.
I solved the issue by checking if lifespan = 0.0F then manually setting matching elements in the Array to NULL, then removing that element from the Array.
Yes, there is a function called Destroy() and then, remember that this does not shrink the array. It will just leave holes in it so when you add more to the array the new ones will be added on top of the old ones, deleted or not.
That is the ONLY line in the SetLifeSpan() function that sets the timer to a non zero value. I KNOW the timer is being set to a non zero value, because of the GEngine->AddOnScreenDebugMessage() I mention in the opening post.
Which means when that timer hits zero it SHOULD already be calling LifeSpanExpired() and subsequently Destroy().
If the actor is not getting destroyed in that case, my assumption is a setting somewhere is preventing Destroy() from doing what it is suppose to.
Turns out the issue was not that the EffectActors Actor was not being destroyed.
The issue was that even though the EffectActors Actor was destroyed, it was still somehow in the EffectActors Array.
I solved the issue by checking if lifespan = 0.0F then manually setting matching elements in the Array to NULL, then removing that element from the Array.