Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

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.