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

I have following code in unity.

void Update()
{
     if (IsPlaying)
     {
         if (!Waiting)
         {
             UpdateTime();
         }
     }
}

public void UpdateTime()
{
    if (!StopUpdateTime)
    {
        CurTime += Time.deltaTime * FastPlayRatio (= 1);
        MyUI.UpdateCurTimeUI(CurTime);
    }
}

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].

solved by change Update to FixedUpdate and Time.fixedDeltatime

I would not advise to use FixedUpdate for updating UI - that will cause it to appear stuttery.

You should be able to configure the build to allow attaching the debugger, see Unity - Manual: Debug C# code in Unity.

1 Like

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.