playMaker

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

Korda

  • Playmaker Newbie
  • *
  • Posts: 13
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, 10:24:09 AM by Alex Chouls »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: A quick question about physics actions and delta time
« Reply #1 on: April 10, 2013, 07: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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: A quick question about physics actions and delta time
« Reply #2 on: April 11, 2013, 01:56:39 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

Korda

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

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: A quick question about physics actions and delta time
« Reply #4 on: April 12, 2013, 12:26:36 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

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: 15500
  • Official Playmaker Support
Re: A quick question about physics actions and delta time
« Reply #5 on: April 15, 2013, 02:09:11 AM »
Hi,

 yes, using the very action I referenced.

bye,

 Jean

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: A quick question about physics actions and delta time
« Reply #6 on: April 15, 2013, 02:27:55 AM »
Thank you, I'm sorry I missed that line  ::)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: A quick question about physics actions and delta time
« Reply #7 on: April 15, 2013, 02:58:22 AM »
no worries :)