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.

Question SphereCastAll for jobs?

Discussion in 'C# Job System' started by unity_30DE33D49AE8A9BAC439, Mar 14, 2023.

  1. unity_30DE33D49AE8A9BAC439

    unity_30DE33D49AE8A9BAC439

    Joined:
    Feb 9, 2023
    Posts:
    2
    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.
    https://docs.unity3d.com/ScriptReference/SpherecastCommand.html "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.
    https://docs.unity3d.com/ScriptReference/RaycastCommand.html "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!
     
  2. unity_30DE33D49AE8A9BAC439

    unity_30DE33D49AE8A9BAC439

    Joined:
    Feb 9, 2023
    Posts:
    2
    Last edited: Mar 16, 2023
  3. Haxel0rd

    Haxel0rd

    Joined:
    May 20, 2021
    Posts:
    31