Vision icon indicating copy to clipboard operation
Vision copied to clipboard

Invalid visibility data

Open AntonPetrov83 opened this issue 2 years ago • 0 comments

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.

AntonPetrov83 avatar Jul 29 '22 11:07 AntonPetrov83