Confused about move_local_x parameters

Godot Version

4.3

Question

Hello, can someone explain to me what is meant by ‘delta’ in the paramater and description of the move_local_x() (and move_local_y()) function?

‘Applies a local translation on the node’s X axis based on the Node._process’s delta. If scaled is false, normalizes the movement.’

I understand that the function uses the local axis of the node and all,i also know what _process’s
and _physics_process’s delta is, but i dont understand why the first argument in move_local_x() is called delta?

i can apply the function outside of _process(), and if for example i run move_local_x(100) the node moves 100 pixels.

i cant see what delta has to do with this function, can someone explain what am i missing? Thank you in advance.

I’ve just recently started learning godot so i apologize if the answer may seem obvious

Delta is time between process. Game devs usually want move object same speed and be not affected by frames peer second.

I know what delta in _process abd _physics_process is, my question is how does it relate to the function move_local_x considering its the name of the parameter.
Not only can the function can be called outside of _process(),
the arugment you give (“delta”) seems to be the pixels the node moves instead

In physics delta is representing a section / distance. For exapmle Δx = x₂ - x₁ or Δt = t₂ - t₁ (Δ is delta).
So I assume delta suppost to be the offset regarding the x-axis in the move_local_x() function.

This affirms my assumption:


(The tutorial the screenshot is from)

The move_local_x() function seems still strange to me since I have no idea what the scaled parameter is suppost to do.

Thanks for answering

this is similar to how i thought it works, but i was just confused on the documentation of it, it might be that the documentation is wrong or weirdly worded.

As for the scaled parameter, afaik it affects the distance traveled depending on the node’s scale if its true
(Using move_local_x(100,true), An object with scale of 1 will move 100 pixels, and will move 200 pixels if it had scale of 2)

1 Like

That makes sense. Maybe you should report the confusion with the documentation of the move_local_x function to where ever you can report mistakes/suggest changes regarding the documentation.