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. Dismiss Notice

Problem with unity 5.0

Discussion in 'Editor & General Support' started by tverdoclub, Mar 10, 2015.

  1. tverdoclub

    tverdoclub

    Joined:
    Mar 7, 2015
    Posts:
    3
    Hy, I have a strange problem, I imported a project from unity 4.6 on unity 5.0 (a game for android).
    With unity 4.6 the game worked perfectly (compiled and installed on the device) instead with unity 5.0 (for example on Nexus or HTC one SV) the speed of the game is increases exponentially.
    How can I solved this problem?
     
  2. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    What do you mean with the speed of the game?
    Does it run faster than you did expect , do you have framerate issues or what is going on?
     
  3. tverdoclub

    tverdoclub

    Joined:
    Mar 7, 2015
    Posts:
    3
    Framerate seem to have multiplied by 10 (On other devices but on my mobile is normal).
     
  4. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Normally you have your frame-rate limited via Vsync to 60 on most desktops or 30 on your mobile devices.
    Your code should be build in that respect to run independent of the frame-rate.
     
  5. Freaking-Pingo

    Freaking-Pingo

    Joined:
    Aug 1, 2012
    Posts:
    310
    For moving and manipulating positions of objects, are you using the Update() loop?. Update loop's rate of execution is dependent on the framerate. Meaning, if going from Unity 4.6 to Unity 5.0, and you saved some performance, the Update Loop will be executed more often. If position are being manipulated within the Update Loop, they will get executed more often. Instead, you should use FixedUpdate(), which is independent on the framerate.
     
  6. Mikea15

    Mikea15

    Joined:
    Sep 20, 2012
    Posts:
    93
    Actually you shouldn't use FixedUpdate unless you're moving your objects with rigidbodies. You should stick with the Update Loop and use Time.deltatime.

    http://docs.unity3d.com/ScriptReference/Time-deltaTime.html

    You should multiply your movement values by it, that way, it will behave the same on different devices and platforms.
     
    Freaking-Pingo likes this.
  7. tverdoclub

    tverdoclub

    Joined:
    Mar 7, 2015
    Posts:
    3
    Okay, thanks a lot