Search Unity

maxhits support for SpherecastCommand?

Discussion in 'Data Oriented Technology Stack' started by AG_davidh, Apr 9, 2019.

  1. AG_davidh

    AG_davidh

    Joined:
    Aug 17, 2017
    Posts:
    2
    Is there a plan for SpherecastCommand to support multiple hit results?

    I'd like to migrate some of our existing SphereCastNonAlloc logic to a background job using SpherecastCommand, however I'm blocked by the limitation that SpherecastCommand only returns one hit instead of multiple. RaycastCommand already supports a maxhits parameter - will this be extended to Sphere/Capsule/Box commands as well?
     
  2. AG_davidh

    AG_davidh

    Joined:
    Aug 17, 2017
    Posts:
    2
  3. Sonorpearl

    Sonorpearl

    Joined:
    Sep 8, 2017
    Posts:
    32
    Any updates on this?
     
  4. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,373
    My suggestion is use Unity.Physics. Create duplicates of your Physx bodies in Unity.Physics, then sync them manually. The query api is so much better that it makes it totally worth it. Don't have to use the pain in the ass batch approach for everything, full range of query types that even go beyond what you can do with Physx.
     
  5. zachlindblad

    zachlindblad

    Joined:
    Sep 29, 2016
    Posts:
    7
    Any updates from Unity on this?
    The batch approach works nicely for me so long as I can get multiple results similar to the RaycastCommand.
    I'm not ready to make the leap in my project to Unity physics, and duplicating objects into a duplicate system that I use only for this purpose seems like it would be overkill/expensive/etc.