Search Unity

RaycastCommand on other Physics Scene?

Discussion in 'Scripting' started by TiToMoskito, May 4, 2020.

  1. TiToMoskito

    TiToMoskito

    Joined:
    Jan 28, 2014
    Posts:
    66
    Is there a way to do an RaycastCommand on an other physics Scene?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    Raycast operates on enabled colliders in the current scene.

    What are you trying to do?
     
  3. CameronND

    CameronND

    Joined:
    Oct 2, 2018
    Posts:
    88
    did you ever find the answer to this?
     
  4. AnsisMalinsUbisoft

    AnsisMalinsUbisoft

    Joined:
    Oct 4, 2019
    Posts:
    10
    Bump. It is possible to create additional physics scenes and raycast against them.

    Code (CSharp):
    1. var scene = SceneManager.LoadScene(0, new LoadSceneParameters(LoadSceneMode.Additive, LocalPhysicsMode.Physics3D));
    2. scene.GetPhysicsScene().Raycast(Vector3.zero, Vector3.zero);
    What's missing is ability to jobify these raycasts.
     
  5. hugeandy

    hugeandy

    Joined:
    Nov 2, 2016
    Posts:
    131
    Bump bump this feels like pretty big missing functionality
     
  6. sue-shon

    sue-shon

    Joined:
    Sep 6, 2021
    Posts:
    2
    Yes! We really need that...! Can it be done in any way as of today?
     
  7. Andefob

    Andefob

    Joined:
    Sep 17, 2018
    Posts:
    99
  8. Steve2375

    Steve2375

    Joined:
    Mar 28, 2015
    Posts:
    42
    Did you guys try setting the property RaycastCommand.physicsScene? I think they added it with 2021.2