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

Platform difference (Mac/PC) with MoveTowards at timeScale = 0

Discussion in 'Editor & General Support' started by iso250, Nov 2, 2015.

  1. iso250

    iso250

    Joined:
    Apr 19, 2015
    Posts:
    28
    Hello all.

    I'm making a game on Mac and I have just tried it out on Windows for the first time and found one aspect to behave VERY differently between the platforms.

    In my game the player can go in to "transfer mode" where if they bump in to an enemy they attach themselves to the enemy. During the attachment process, the player moves on top of the enemy. I have achieved this by setting the timeScale to 0, using this line...

    transform.position = Vector2.MoveTowards(transform.position, TransferToPosition, 0.0075f);

    and when the MoveTowards is complete, setting the timeScale back to 1.

    On my Mac the game freezes whilst the player takes about a second and a half to move in to position and then everything resumes as normal. This is working as intended. On a PC, however, the transfer happens in a split second.

    Is my line of code wrong, or should I be using another method? The code must go in the Update section as the game has to be at timeScale = 0 whilst the transfer happens. If timeScale is not zero then other aspects of the game won't make sense.

    Can anyone please help me? Thank you in advance.
     
  2. iso250

    iso250

    Joined:
    Apr 19, 2015
    Posts:
    28
    UPDATE

    Sorry, it turns out the difference was due to me running the Windows version at "Fastest" graphics quality.