Search code examples
c#unity-game-enginescene-manager

Simulating a second, hidden physics scene into the future on a single frame to predict the trajectories of planets?


I want to simulate the trajectories of planets in a seperate scene to find out where they will be in the future. I drew a quick diagram to demonstrate.

Is there a way to simulate 2 scenes separately, hiding one but showing the other? I tried this which says they don't interact with each other, but when I tried it they still collided.


Solution

  • Yes, there is a way, if you put all "hidden" objects, like planets on a reparate layer in unityenter image description here

    and disable collisions between that and any other layers in the edit/project setting/physicsenter image description here

    This way those objects won't have any effect on the rest of your scene.

    To visually hide the objects simply disable the rendering of that layer in your scene camera. And that's it, if hope this was helpful.