Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question How to debug if unity and Steam build shows different behaviour?

Discussion in 'Windows' started by leegod, Feb 18, 2024.

  1. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,493
    I have following code in unity.

    Code (CSharp):
    1.  
    2. void Update()
    3. {
    4.      if (IsPlaying)
    5.      {
    6.          if (!Waiting)
    7.          {
    8.              UpdateTime();
    9.          }
    10.      }
    11. }
    12.  
    13. public void UpdateTime()
    14. {
    15.     if (!StopUpdateTime)
    16.     {
    17.         CurTime += Time.deltaTime * FastPlayRatio (= 1);
    18.         MyUI.UpdateCurTimeUI(CurTime);
    19.     }
    20. }
    Strange thing is, in unity editor, there is no problem and time UI updated well when play.

    but after make Steam PC standlone build, play through Steam, then this time UI does not changed.

    Why this happen? How to debug visual studio like doing F9 key and set stop point when unity editor while playing Steam build?

    I tried to debug this, attach visual studio when playing Steam build, but F9 break point changed to red empty circle and says [Can't find the location].
     
    Last edited: Feb 18, 2024
  2. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,493
    solved by change Update to FixedUpdate and Time.fixedDeltatime
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,737
    spiney199 likes this.
  4. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,493
    I don't know why but only standalone steam build does not shows correctly at update my game time.
    Android, unity editor, nintendo switch all worked with just update and deltatime code.
    But only steam build work after change to fixed.

    And debugger also did not worked with steam standalone build.