Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Confused about per-scene physics

Discussion in '2018.3 Beta' started by Tumble, Oct 9, 2018.

  1. Tumble

    Tumble

    Joined:
    Feb 24, 2018
    Posts:
    3
    As documents says:
    LocalPhysicsMode
    enumeration
    Description
    Provides options for 2D and 3D local physics.

    By default, when a Scene is created or loaded, any 2D or 3D physics component added to a GameObject within the Scene is added to the default physics Scene. Each Scene however has the ability to create and own its own (local) 2D and/or 3D physics Scene. This option can be used when creating or loading a Scene to specify whether a 2D and/or 3D physics Scene should be created.

    Then I do some experiment:
    I run scene A in editor play mode and then open scene B using scripts:SceneManager.LoadSceneAsync(name of scene B, new LoadSceneParameters(LoadSceneMode.Additive, LocalPhysicsMode.Physics3D));
    As expected, there should be physics effects in scene B but actually there is no physics effects in scene B.This is what I confused. Can anyone tell me why?(test in editor version:2018.3.0b4)
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,082
    It's not clear what you mean by this as it's a little vague. If you mean that the physics scene isn't auto-simulated then that is the current behaviour. You'll need to manually simulate the scene however you want using "PhysicsScene.Simulate".

    Per-scene settings for auto-simulation and a whole host of options are coming but it's unclear whether that'll land in 2018.3
     
  3. Tumble

    Tumble

    Joined:
    Feb 24, 2018
    Posts:
    3
    I used to believe that local scene physics simulation is automatic. Now I know it isn't. Thank you very much.
     
  4. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    591
    Well, we used to have only one physics scene so everything's been local to it in a way :)
     
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,082
    Not a problem at all, sorry for the confusion.