Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Physics Changes when loading a new Scene

Discussion in 'Editor & General Support' started by NavernM, Nov 10, 2019 at 7:08 AM.

  1. NavernM

    NavernM

    Joined:
    Sep 7, 2019
    Posts:
    1
    Hi all.

    I am fairly new to unity, and have not coded in many years so I am still getting around C#. So please mind my understanding of some of the concepts I describe below

    I have a created a scene ("Ball") with a ball bouncing (adapted from the oculus ball tutorial). I have used a rigidbody with a sphere collider and have used a script for the ball to bounce forward (with the help of some other tutorials on the web). This scene on it's own works fine, I mean the physics of the ball seems correct.

    Now I have created another scene "SplashScreen", from which I want to invoke the "Ball" scene. It does this but then the "Ball" scene loads, the motion of ball is changed in that it's slower and it almost seems like the collider parameters have changed (but it hasn't). Here is my code for the "SplashScreen". Is there something that I am missing or that I need to add in "Ball" scene to like reinitialize the physics engine or something similar? Thanks!


    public class SceneSwitch : MonoBehaviour
    {
    public VideoPlayer videoPlayer;
    void Start()
    {
    {
    videoPlayer.loopPointReached += EndReached;
    }

    void EndReached(UnityEngine.Video.VideoPlayer vp)
    {
    SceneManager.LoadScene("Ball");
    SceneManager.UnloadSceneAsync("SplashScene");
    }
    }
    }