playMaker

Author Topic: Delta Time with Rigidbodies  (Read 1448 times)

NewTo

  • Playmaker Newbie
  • *
  • Posts: 12
Delta Time with Rigidbodies
« on: April 01, 2020, 05:08:25 AM »
Hello,

Do I need to use delta time when I use the get axis action to set the velocity of a gameobject that has a rigidbody ?

See you !
Newto


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Delta Time with Rigidbodies
« Reply #1 on: April 01, 2020, 06:38:31 AM »
hi.
if that's needed it is already doing so in the actions.

But i don't think set velocity needs delta time

An action like Float Add (when per Second is set) uses Time.deltaTime

Are you following a tutorial? (just wondering why you think you need this :) )

NewTo

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Delta Time with Rigidbodies
« Reply #2 on: April 01, 2020, 07:33:04 AM »
I'm not actually following a tutorial but... ^^

I have downloaded, from the ecosystem, tripping cube over. I saw that for the quaternion rotation, delta time is used. Then I started to try to understand what it is. What seems clear is that it is the time passed since last frame, used in order to move things at the same speed on different computers who would have different frame rates. But if it was that simple, I should always use it right ?

What I do not understand yet is when I do need to use it. Im trying to see why I should, or not, use it to move and turn game objects with rigidbodies such as players and enemies.

I think that it is important to understand this because of I'm doing a multiplayer topdown shooter. So different people with different PCs at the same time.
« Last Edit: April 01, 2020, 07:35:50 AM by NewTo »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Delta Time with Rigidbodies
« Reply #3 on: April 01, 2020, 11:04:51 AM »
Hi.
Most action that need to sue delta time has it build in in their actions.
the delta time has nothing directly to do with rigidbody's

for example on the float action that i mentioned before.

When you set every frame on, it will add the float every frame (and delta is not used inside the script)
But when you turn on 'Per Second',
It will still do add float every frame But it will use the Time.deltaTime to calculate how much it needs to add every frame to reach the set value each second.

Set velocity is setting a velocity to a object every frame.
also 'Get Axis' is getting the value every frame.

Translate (this can move objects without a rigidbody, but ignores physics) will use Time.deltaTime if you set 'Per Second'

May i ask which action is showing a setting for delta time?

NewTo

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Delta Time with Rigidbodies
« Reply #4 on: April 01, 2020, 11:26:04 AM »
May i ask which action is showing a setting for delta time?

In the tripping cube over, get time info is used to get the delta time.
It is in the animate state.

Thanks for your answers.

See you,
NewTo