Error (10,38): Expected end of statement after expression

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

extends KinematicBody2D
var speed = 1

Declare member variables here. Examples:

var a = 2

var b = “text”

Called when the node enters the scene tree for the first time.

func _physics_process(delta):
if Input.is_key_pressed(KEY_W):
move_and_collide(Vector2(0,-speed)):
else Input.is_key_pressed(KEY_S):
move_and_collide(Vector2(0,speed)):

:bust_in_silhouette: Reply From: eod

Your code came through a bit funky, but I’m taking a guess and thinking that you need to remove the semicolon at the end of these 2 lines:

moveandcollide(Vector2(0,-speed)):
...
moveandcollide(Vector2(0,speed)):