Destroying Effect entity vs Modifying variable at index

If I’m creating effects for abilities and setting them as a variable at index, Will destroying the effect later at that index do the same as removing the variable at that effect index or does that entity still exist somewhere and eventually take it’s toll on game performance. I’ve seen some workshop codes that just put all their effects into an array and periodically loop remove at index 0 3or4 times or “first of” etc. Is that also destroying the entity?

No the entity will still exists, when you modify the variable or value at an array index before the action or function to specifically destroy that entity is called and if that stored value is the last created “entity” id. If you control the entity’s visibility or any other reevaluatable properties with variables, i don’t quite understand your context right, what are you referring to excactly? Is it the former and you mean the entity’s id storage, then keep in mind modifying it won’t as already told destroy that entity that id is referring to, but the call of the destruction action later on won’t work for it, since it’s reference has changed then you’d may need to call the destroy all (regardless of the id) “entities” action. And after that relying on the variable or array you stored the reference id would not make any sense, due no entities would exists to relate to the ids, lastly you would empty that array or set the variable to null.