Vision
Vision copied to clipboard
Invalid visibility data
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.