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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

New Scene Physics Lag

Discussion in 'Physics' started by DannyK89, Nov 17, 2015.

  1. DannyK89

    DannyK89

    Joined:
    Aug 12, 2015
    Posts:
    9
    Hi All,

    I was wondering if anyone ever came across this issue before. We start off with a scene in a game that uses physics. Once the player wins the game and tries to load a new level the physics lags out. It only happens when we load a new level. If anyone has had any issues like this before please let me know. I have searched to code and can't seem to find anything that would cause this issue to happen. Also when we load a new level we load it from scratch using the Application.LoadLevel method.

    Thanks,
    DannyK89
     
  2. MortenSkaaning

    MortenSkaaning

    Joined:
    Jan 16, 2015
    Posts:
    120
    can you post a screenshot from the profiler?
     
  3. DannyK89

    DannyK89

    Joined:
    Aug 12, 2015
    Posts:
    9
    Hi,

    Sorry for taking so long for to respond. Let me know if that is what you are looking for.

    Thanks,
    DannyK89
     

    Attached Files:

  4. MortenSkaaning

    MortenSkaaning

    Joined:
    Jan 16, 2015
    Posts:
    120
    oh, I should have mentioned that you should switch to the Timeline view so I can see what's going on, like so:
    upload_2015-12-7_14-26-27.png
     
  5. DannyK89

    DannyK89

    Joined:
    Aug 12, 2015
    Posts:
    9
    Hi,

    I hope this helps. Let me know if there is anything else I can get you.

    Thanks,
    DannyK89
     

    Attached Files:

  6. MortenSkaaning

    MortenSkaaning

    Joined:
    Jan 16, 2015
    Posts:
    120
    Hi Dan,

    Did you select the frame with physics spike and zoom all the way out to see the whole frame in the timeline view? (press 'f' on the view).
     
  7. DannyK89

    DannyK89

    Joined:
    Aug 12, 2015
    Posts:
    9
    Hi,

    I pressed "f" but that really didn't do anything. I was able to connect to a larger monitor so it gave me a little better view of what is going on. So the game runs smoothly when the Physics spikes up and down and then it goes down to zero when you win the game but when we load the level again it jumps and stays really high. I have attached two screen shots. One with the frame selected in the spikes and another with the frame selected when the physics lags. Let me know if this helps and if you need anything else.

    Thanks,
    DannyK89
     

    Attached Files:

  8. MortenSkaaning

    MortenSkaaning

    Joined:
    Jan 16, 2015
    Posts:
    120
    Hi,

    You have to be on the "Cpu Usage" profiler for my instructions to work :)
     
  9. DannyK89

    DannyK89

    Joined:
    Aug 12, 2015
    Posts:
    9
    Hi,

    So I went to the Cpu Usage part of the profiler and I filtered it down by Physics. It looks like after the Game Frame resets the physics stays off or something. Like before the spike the physics is running smoothly but after the spike and the game reset the physics does not work right. Like to only works every so often.

    I have attached a image so hopefully that will help.

    Also sorry for the long pause in response.

    Thanks,
    DannyK89
     

    Attached Files: