SphereCastAll for jobs?

Hello,

I would like to use SpherecastCommand with multiple hits like the SphereCastAll in Physics but unfortunatelly this command doesn’t return more than one hit per command.
Unity - Scripting API: SpherecastCommand “The result for a command at index N in the command buffer is stored at index N in the results buffer.”

Is there any other solution that I could use to have a similar result?

I thought to use RaycastCommand that returns multiple hits per command but it’s not good enough unless I throw a lot of them to recreate the sphere cast behaviour.
Unity - Scripting API: RaycastCommand “The result for a command at index N in the command buffer will be stored at index N * maxHits in the results buffer.”

Thank you so much!

If your project is in 2022 Unity version, you could use OverlapCapsuleCommand due that a sphere raycast is a really long capsule.

Also the SphereCastCommand return multiple hits from the 2022.2

I can’t use it because we are in a previous version

Check Physics.OverlapSphere, this returns an array with all colliders that was hit inside the sphere.