Removed all instances of velocity being defined for CharacterBody2D (#6862)

* Removed all instances of velocity being defined for `CharacterBody2D`
This commit is contained in:
Emily
2023-03-03 08:07:15 +01:00
committed by GitHub
parent d626c1aa89
commit 3585c66213
3 changed files with 7 additions and 23 deletions
+2 -2
View File
@@ -293,7 +293,7 @@ Jump:
if Input.is_action_just_pressed("jump"):
velocity.y = JUMP_SPEED
velocity = move_and_slide(velocity)
move_and_slide()
.. code-tab:: csharp
@@ -301,7 +301,7 @@ Jump:
if (Input.IsActionJustPressed("jump"))
velocity.Y = JumpSpeed;
velocity = MoveAndSlide(velocity);
MoveAndSlide();
All common behaviors and logic can be done with just vectors.