playMaker

Author Topic: A quick question about physics actions and delta time [SOLVED]  (Read 3191 times)

Korda

  • Playmaker Newbie
  • *
  • Posts: 13
    • View Profile
Hi,
I am trying to replicate a spaceship controller script that a friend of mine made in c# using Playmaker. I noticed that my friend scales his torques and forces by deltatime so that the controls do not vary with frame rates. My question is: do the addForce and addTorque functions scale by deltatime? I had a look at the scripts and they do not seem to mention it.
« Last Edit: April 15, 2013, 07:24:09 AM by Alex Chouls »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: A quick question about physics actions and delta time
« Reply #1 on: April 10, 2013, 04:11:18 AM »
I'm not sure about deltatime since I haven't messed with it, I know thats typical in scripting though.

For actions, running it in fixed update instead of update is static regardless of framerate.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: A quick question about physics actions and delta time
« Reply #2 on: April 10, 2013, 10:56:39 PM »
Hi,

 the addForce and addTorque do not implement the deltatime trick internally. You will have to multiply the force you want to apply by the deltatime prior them actions.

 you can get the deltatime in playmaker using the action "get time info" and select "deltatime",

 Or the question is actually about what is this deltatime to being with?

http://docs.unity3d.com/Documentation/ScriptReference/Time-deltaTime.html
http://answers.unity3d.com/questions/296336/timedeltatime.html

bye,

 Jean

Korda

  • Playmaker Newbie
  • *
  • Posts: 13
    • View Profile
Re: A quick question about physics actions and delta time
« Reply #3 on: April 11, 2013, 03:14:49 AM »
Thanks Jean that helps.

megmaltese

  • Sr. Member
  • ****
  • Posts: 351
    • View Profile
Re: A quick question about physics actions and delta time
« Reply #4 on: April 12, 2013, 09:26:36 AM »
Hi,

 the addForce and addTorque do not implement the deltatime trick internally. You will have to multiply the force you want to apply by the deltatime prior them actions.

 you can get the deltatime in playmaker using the action "get time info" and select "deltatime",

 Or the question is actually about what is this deltatime to being with?

http://docs.unity3d.com/Documentation/ScriptReference/Time-deltaTime.html
http://answers.unity3d.com/questions/296336/timedeltatime.html

bye,

 Jean

Uhh is it possible to do this inside PlayMaker???

I want to make a racing game and of course the power imprinted to wheels can't be frame dependent!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: A quick question about physics actions and delta time
« Reply #5 on: April 14, 2013, 11:09:11 PM »
Hi,

 yes, using the very action I referenced.

bye,

 Jean

megmaltese

  • Sr. Member
  • ****
  • Posts: 351
    • View Profile
Re: A quick question about physics actions and delta time
« Reply #6 on: April 14, 2013, 11:27:55 PM »
Thank you, I'm sorry I missed that line  ::)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: A quick question about physics actions and delta time
« Reply #7 on: April 14, 2013, 11:58:22 PM »
no worries :)