![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | sohm14 |
extends CollisionShape2D
var score : int = 0
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
if Input.is_action_pressed("move_left"):
vel.x -= speed
if Input.is_action_pressed("move_right"):
vel.x += speed
move_and_slide
Im trying to use the move_and_slide
function in my Kinematic2D script but it raises an error. Please help me clarify this doubt as I am new to Godot thanks.