playMaker

Author Topic: Scale Time action bug  (Read 3938 times)

dasbin

  • Junior Playmaker
  • **
  • Posts: 92
Scale Time action bug
« 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.
« Last Edit: October 01, 2012, 05:05:59 PM by dasbin »

dasbin

  • Junior Playmaker
  • **
  • Posts: 92
Re: Scale Time action bug
« Reply #1 on: November 21, 2012, 02:41:29 PM »
Bump.
Bug still appears in latest version.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Scale Time action bug
« Reply #2 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

dasbin

  • Junior Playmaker
  • **
  • Posts: 92
Re: Scale Time action bug
« Reply #3 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.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Scale Time action bug
« Reply #4 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...