mirror of
https://github.com/stan220/godot-docs.git
synced 2026-09-08 19:29:06 +00:00
Removed all instances of velocity being defined for CharacterBody2D (#6862)
* Removed all instances of velocity being defined for `CharacterBody2D`
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user