I am a newbie and I want to know how I can make my Kinematic body move to right left up and down .

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Want to learn making

I am a newbie and I want to know how I can make my Kinematic body move to right left up and down .
My code is :
extends KinematicBody2D
class_name Actor
var speed : int = 200
var jumpForce : int = 600
var gravity : int = 800

var vel : Vector2 = Vector2 ()
onready var sprite : Sprite = get_node(“Sprite”)
func _physics_process(_delta):
vel.x=0
#movement inputs
if Input.is_action_pressed(“move_left”):
vel.x-=speed
if Input.is_action_pressed(“move_right”):
vel.x+=speed
#apllying the velocity
vel = move_and_slide(vel , Vector2.UP)

:bust_in_silhouette: Reply From: aadyainfotainment

Check the below page for the 2d movements: