Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: dasbin on October 01, 2012, 04:50:57 PM

Title: Scale Time action bug
Post by: dasbin on October 01, 2012, 04:50:57 PM
Hello,

I noticed Scale Time would always set the fixed timestep to 0.02 * timescale no matter what. Even if "Adjust fixed timestep" is off, and the 0.02 is an arbitrary value hard-coded into the action. It seems the action is unfinished. I found this offending code in it:

         //TODO: how to get the user set default value?
         Time.fixedDeltaTime = 0.02f * Time.timeScale;

In my build, I will just modify the action to remove this line (I don't need to adjust fixed timestep at all), but I thought you might want to know the action is currently broken.
Title: Re: Scale Time action bug
Post by: dasbin on November 21, 2012, 02:41:29 PM
Bump.
Bug still appears in latest version.
Title: Re: Scale Time action bug
Post by: jeanfabre on November 22, 2012, 07:36:30 AM
Hi,

 Have you reported this via the playmaker bug report?

 I would simply create a custom action and put it on this forum, do you have a custom action done to address it?

bye,

 Jean
Title: Re: Scale Time action bug
Post by: dasbin on November 22, 2012, 05:33:47 PM
No, I just commented the line out of the action myself, because I don't have an idea of what the original intention behind its behaviour way. In other words, in what way should fixed timestep scale with the timescale? And when would one ever need to do this? I can see an action that independently scales fixed timestep (or both, with separate values) but I'm not sure how scaling one relative to the other is useful.
Title: Re: Scale Time action bug
Post by: Alex Chouls on November 22, 2012, 05:45:39 PM
It's based on advice in the Unity script reference:
http://docs.unity3d.com/Documentation/ScriptReference/Time-timeScale.html

Quote
If you lower timeScale it is recommended to also lower Time.fixedDeltaTime by the same amount.

The example in the docs uses 0.02, which is the default fixed timestep. If you haven't changed the fixed timestep this should work fine...

The TODO was a note to self to investigate a way to get the current fixed timestep. When I looked originally I didn't see a way, but maybe it's been added to the Unity API...