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

My project runs too fast in Unity Editor. How can i fix this?

Discussion in 'Editor & General Support' started by bekiryanik, Jun 21, 2015.

  1. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    Hello,

    Before i upgrade Unity 4.5 to 4.6, my project was running with normal speed in unity editor. But after the upgrade, project started to run too fast in editor. It runs with normal speed in android device. How can i fix the speed of unity editor?

    Thank you!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,852
    It sounds like your scripts are frame rate dependent. The higher the frame rate the faster things move. You should be using Time.delaTime in your scripts when moving objects etc. Either that or you have changed the game speed multiplier in the editor. It's hard to say without more details.
     
  3. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    This thing came up after i updated unity. It is really interesting. I think it is not about using Time.deltaTime because if it did about that, some of things would run with normal speed and some of things would run faster, and game would run fast in android device either, am i right? It seems like there is a problem with the editor. Game speed multiplier can be connected with it. How can i fix it?
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,852
  5. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    I checked it but it is not about timeScale. Everything is running fast for instance, sounds, animations, physics...
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,852
    That does sound strange. Can you share the project?
     
  7. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    I would like to share it but it's really huge project. Maybe it may take a week for me to upload it and share. Now i am downloading previous versions of unity to see if project is working with normal speed.
     
  8. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    I installed 4.6.5 version of unity but the problem still occurs. Like i said before, it is only fast in Unity editor, it does run with normal speed in Android device.
     
  9. chelnok

    chelnok

    Joined:
    Jul 2, 2012
    Posts:
    680
    That happened to me once. It was really weird, and i thought i was imagining things or having psychotic episode or something :) Unfortunately i cant remember what fixed it, but if it did happened to me now, i would first try to reimport everything, then check entire project if there was any timescale code, then try different timescales in any script where timescale was used. While its only happening in editor, perhaps there is corrupted meta or cache file or something? Backup your project, and try if deleting folder library/metadata helps.
     
  10. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I think it is most likely about not using Time.deltaTime (properly). The idea behind using Time.deltaTime is to make the movement independent of the actual frame rate. With Android, you usually have lower frame rates and if you don't make your scripts frame rate independent, the movement on slower devices will be slower.
    I suggest that you show your movement script and please don't forget to use code tags:
    http://forum.unity3d.com/threads/using-code-tags-properly.143875/
     
    karl_jones likes this.
  11. chelnok

    chelnok

    Joined:
    Jul 2, 2012
    Posts:
    680
    @Dantus If it was time.deltatime problem, it shouldnt affect sounds, animation, etc. Sounds more like timescale issue, or some weird bug.
     
  12. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,852
    @bekiryanik create a duplicate of the project, chop out as much as you can to reduce file size whilst keeping the issue and upload it so we can take a look.
     
  13. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    @chelnok and @Dantus thank you for your answers. I will work on timescale. I have find out something about this issue today. If i use small editor screen, the project run with normal speed. If i use larger editor screen, the project run too fast. :) This thing may take us to the solution. What do you think about this one?

    @karl.jones i will try to do that but i think it's going to take a while.

    Thanks you so much for interesting!
     
  14. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Sounds to me you have vsync off now but it was on before.

    ...and yes, you really should be multiplying any movement or changing variables over time with Time.deltaTime, which will eliminate these issues regardless of vsync.
     
    rahulk1991 and karl_jones like this.
  15. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    @hippocoder Bingo! Now everything works fine, thank you so much. I've closed vsync for a long time ago and i forget that i closed it. Now, the problem is solved. :)
     
  16. Ace71425

    Ace71425

    Joined:
    Oct 8, 2017
    Posts:
    2
    I know this is a pretty old post but....I stumbled across this because my game was flying way too fast in the editor...found out it was because my monitor was on 144hz refresh rate...changed it to 60 and it's fine
     
  17. CavernHead

    CavernHead

    Joined:
    Mar 30, 2017
    Posts:
    10
    I have also been having problemes my game speed. I have consitenly been multiplying any mouvment by Time.deltatime. But when the v-sync is off the game goes too fast and if the frame rate goes down the speed of the game slows down. My Time.deltatime value is just not working correctly. My alternetif is to use unscaledDeltatime and multiply it with time scale since in my game their is variances of Time scale but it feels like a work around instead of a fix of the problem. I would like to understand at least why Time.deltatime doesn't work like what i would imagine.
     
  18. CavernHead

    CavernHead

    Joined:
    Mar 30, 2017
    Posts:
    10
    Uppon further testing I have realised that the v-sync mode affects the game speed and the Time.deltatime is not propaly changed but if in the ProjectSettings>time>maximumAllowedTimeStep the value is too small that limits the value of Time.deltatime. So that can also be a probleme causing your game to be slow when it shouldent.