Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Korda on April 10, 2013, 03:56:11 AM

Title: A quick question about physics actions and delta time [SOLVED]
Post by: Korda on April 10, 2013, 03:56:11 AM
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.
Title: Re: A quick question about physics actions and delta time
Post by: Lane 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.
Title: Re: A quick question about physics actions and delta time
Post by: jeanfabre 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
Title: Re: A quick question about physics actions and delta time
Post by: Korda on April 11, 2013, 06:14:49 AM
Thanks Jean that helps.
Title: Re: A quick question about physics actions and delta time
Post by: PolyMad 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!
Title: Re: A quick question about physics actions and delta time
Post by: jeanfabre on April 15, 2013, 02:09:11 AM
Hi,

 yes, using the very action I referenced.

bye,

 Jean
Title: Re: A quick question about physics actions and delta time
Post by: PolyMad on April 15, 2013, 02:27:55 AM
Thank you, I'm sorry I missed that line  ::)
Title: Re: A quick question about physics actions and delta time
Post by: jeanfabre on April 15, 2013, 02:58:22 AM
no worries :)