If you select the CharacterBody2D template, you get this line:
velocity.x = move_toward(velocity.x, 0, SPEED)
However, the docs say that the third parameter is delta. This means that velocity.x is set to 0 immediately since it can't be any greater than SPEED. The line could be replaced by velocity.x = 0.
I think the line should be replaced by velocity.x = move_toward(velocity.x, 0, SPEED * delta), right?
Also, someone on Discord confused the delta of the move_toward function with the _physics_processdelta. Perhaps the docs should clarify that they're not the same and that delta just means change?
Steps to reproduce
Make a CharacterBody2D with the default template for it.
Godot version
4.0 stable
System information
win 11
Issue description
If you select the CharacterBody2D template, you get this line:
velocity.x = move_toward(velocity.x, 0, SPEED)
However, the docs say that the third parameter is
delta
. This means thatvelocity.x
is set to 0 immediately since it can't be any greater thanSPEED
. The line could be replaced byvelocity.x = 0
.I think the line should be replaced by
velocity.x = move_toward(velocity.x, 0, SPEED * delta)
, right?Also, someone on Discord confused the
delta
of themove_toward
function with the_physics_process
delta
. Perhaps the docs should clarify that they're not the same and that delta just means change?Steps to reproduce
Make a CharacterBody2D with the default template for it.
Minimal reproduction project
N/A