Search Unity

Question Anyone successed with OverlapSphereCustom?

Discussion in 'Physics for ECS' started by eggsamurai, Jan 24, 2021.

  1. eggsamurai

    eggsamurai

    Joined:
    Oct 10, 2015
    Posts:
    114
    OverlapSphere works fine, but OverlapSphereCustom get no hits Always
    Anyone tried it?
     
    tertle likes this.
  2. papopov

    papopov

    Joined:
    Jun 29, 2020
    Posts:
    32
    Hey, it's strange that OverlapSphereCustom doesn't work, since OverlapSphere depends on it.
    It may have something to do with how your custom collector is set up, so could you share a repro (or paste the collector code, and the code that's calling the query), so I can take a deeper look.
     
  3. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    300
    Stumbled a little on that until I realized that the Fraction part of the collector doesn’t represent a fraction, but rather the radius of the overlapping sphere.

    Maybe that was the issue?
     
  4. papopov

    papopov

    Joined:
    Jun 29, 2020
    Posts:
    32
    That is correct, yes.
    OverlapSphereCustom uses PointDistance query in the background, and in distance queries, Collector's maxFraction actually represents the max distance.
     
    krooninator and eggsamurai like this.
  5. zb737472783

    zb737472783

    Joined:
    Nov 8, 2018
    Posts:
    19
    hi,maxFraction: What exactly does it mean