What is the functionality of node : Get World Delta Seconds ?

as shown in the picture, I was watching a tutorial video of how to create lean aim sight for FPS game, I’m just curious ,could anyone tell me what is the primary meaning of the node Get World Delta Seconds? what is the very reason that we need to use this node? I also see this node in controller input or something xD . Appreciated

Its the number of seconds since last frame. The number gets smaller the higher the FPS. You can use the green pin in the “Event Tick” node as well.

If you do something on tick like moving an object 1 meter per tick then it would move faster or slower depending on someones framerate (each frame 1 tick).
If you multiply the movement speed by world delta seconds you get 1 meter per second instead of per tick.

Pseudocode

MovementSpeedPerSecond = 1
FPS = 60
DeltaSeconds = 1 / FPS 
// (DeltaSeconds == 0,0166666666666667)
MovementSpeedPerTick = MovementSpeedPerSecond * DeltaSeconds 
// (MovementSpeedPerTick  == 0,0166666666666667)

OR

MovementSpeedPerSecond = 1
FPS = 30
DeltaSeconds = 1 / FPS 
// (DeltaSeconds == 0,0333333333333333)
MovementSpeedPerTick = MovementSpeedPerSecond * DeltaSeconds 
// (MovementSpeedPerTick == 0,0333333333333333)


OnTick {
  MoveStuff(Object, MovementSpeedPerTick);
}

1 Like

HI,

So, if i do not use tick but a movement based on a “move component to” node for example, i can set seconds directly here for my speed, it won’t affect the movement regardless of the hardware?

If you can set seconds:

“move X from A to B in 5 seconds” then fast or slow hardware does not change where X will be in 5 seconds.

If something is purely tick based it would be different:

“move X by C units per tick”, then running 60 FPS on your hardware would cause C * 60 per second.

1 Like