Hi!
From the documentation:
public bool IsVisible(int index);
Note that this method uses the most recently computed visibility states. Visibility is updated immediately before rendering, so using this method in Update/LateUpdate will provide results based on calculations from the previous frame.
IndexOf and all its usages, including IsVisible return invalid results because of indices mismatch between current m_Targets list and CullingGroup latest culling results on the frame when m_Targets is being modified.
Consider using EraseSwapBack group of methods.
Hi!
From the documentation:
IndexOfand all its usages, includingIsVisiblereturn invalid results because of indices mismatch between currentm_Targetslist andCullingGrouplatest culling results on the frame whenm_Targetsis being modified.Consider using
EraseSwapBackgroup of methods.