1

Code inside a method that gets called in the FixedUpdate()

Debug.Log("Tran: " + Mathf.Min(Time.timeSinceLevelLoad * (1 / movementSpeedTransitionLength), 1));
Debug.Log("LevelLoad: " + Time.timeSinceLevelLoad);

After some time the output looks like this: Transition gets printed two times while LevelLoad only gets Printed once

I cant figure out how the lower value gets calculated. The movementSpeedTransitionLength is equal to 20, so it should need 20 seconds for the code to reach a transition value of 1. The Level Load correctly measures the time until then, also the transition value reaches 1, but only every second time.

  • 1
    Nothing else is printing “tran”? Is this the only and exact code? – BugFinder Aug 14 '22 at 11:28
  • Yes, I cant remember writing this code twice, also I jumped to the Debug Logs using a double click onto the Console message – Cyklon 3000 Aug 14 '22 at 12:44
  • 1. does it do the same in update()? 2. can you try to bot use the second argument? 3. try other debyg.log messages and see if they print twice. – gbe Aug 14 '22 at 19:59

0 Answers0