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.

Raycasts in Edit Mode

Discussion in 'Physics for ECS' started by bartekOrbital, Jul 12, 2021.

  1. bartekOrbital

    bartekOrbital

    Joined:
    Feb 28, 2020
    Posts:
    1
    Hello, is it possible to raycast in edit mode at the moment? I'm having trouble with accessing PhysicsWorld from my MonoBehaviour. It seems like Editor World doesn't have PhysicsWorld, but maybe there is a workaround?


    Code (CSharp):
    1. var world = World.DefaultGameObjectInjectionWorld.GetExistingSystem<BuildPhysicsWorld>().PhysicsWorld;
     
  2. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
    No, the PhysicsWorld is runtime only at the minute.