Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice

RaycastCommand on other Physics Scene?

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

  1. TiToMoskito

    TiToMoskito

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

    Kurt-Dekker

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

    What are you trying to do?
     
  3. CameronND

    CameronND

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

    AnsisMalinsUbisoft

    Joined:
    Oct 4, 2019
    Posts:
    6
    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:
    91
    Bump bump this feels like pretty big missing functionality
     
  6. sue-shon

    sue-shon

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

    Andefob

    Joined:
    Sep 17, 2018
    Posts:
    63
unityunity