Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

CullingGroup: CullingDistanceBehaviour is a myth?

Discussion in 'Scripting' started by PanicEnsues, Jul 29, 2019.

  1. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    185
    The docs claim you can call CullingGroup.SetBoundingDistances with a second param: "An array of CullingDistanceBehaviour settings". But that appears to be a lie, the method doesn't take a second arg, and "CullingDistanceBehaviour" doesn't seem to be an actual thing in UnityEngine (at least in 2018.4).

    Am I being stupid and missing something here?

    -Scott
     
  2. ratneshpatel

    ratneshpatel

    Joined:
    Oct 10, 2017
    Posts:
    21
    Yes, I confirm the same. It only takes float array as the first parameter and there is no second parameter. The docs however says it takes second parameter array.
    Also there is no such enum as CullingDistanceBehaviour even not in any experimental classes.
     
  3. ratneshpatel

    ratneshpatel

    Joined:
    Oct 10, 2017
    Posts:
    21
    I am suspicious weather I should use CullingGroup API. Maybe it is not completely ready?
     
  4. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    185
    I do still recommend using CullingGroups for maximum performance with a large object set. You'll just have to selectively ignore certain vaporware features. :)
     
  5. ratneshpatel

    ratneshpatel

    Joined:
    Oct 10, 2017
    Posts:
    21
    Thank you for revert @PanicEnsues

    After writing my last message and I am using Culling Group API extensively. I think it is one of the best features which goes unnoticed
    Thank you to @superpig for making it.

    I have created an event system which informs all enemies when player is in certain range with them. This makes distance check breeze and allow for enabling and disabling components based on player distance.

    I was thinking rather than making all the objects (~1000 of them) on a 1kmx1km terrain if I can scatter 100 culling spheres across the terrain and makes the objects near to it listen to it when player is near to that sphere.

    That sphere can make all the objects near it add to CullingGroup and increase the CullingGroupCount property.

    Any suggestions?