Line 12(return value discarded) the function 'move_and_slide()' returns a value, but this value is never used

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By BigKing

1 extends KinematicBody2D
3 var velocity = Vector2()
7 func _physics_process(_delta):
9 if Input.is_action_pressed(“ui_right”):
10 velocity.x = 30
12 move_and_slide(velocity)

:bust_in_silhouette: Reply From: Zylann

The script editor tells you move_and_slide returns a value, and that value may be important so make sure you really intend to not use it.

If you really don’t want to use the value, then the warning might be annoying and in fact you can turn it off in editor settings.
But make sure you know what you are doing: Using KinematicBody2D — Godot Engine (3.2) documentation in English