Unexpected "identifier" in class body

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

Problem with move_and _slide function

extends CharacterBody2D

var velocity : Vector2

@export var speed : int = 1000
@export var gravity: float = 55
@export var jump_force : int = 1600

func _physics_process(delta):
if not is_on_floor():
velocity.y += gravity
if velocity.y >2000:
velocity.y = 2000

if Input.is_action_just_pressed("ui_right"):
	velocity.x = speed
	$Sprite.flip_h = false
elif Input.is_action_just_pressed("ui_left"):
	velocity.x = -speed
	$Sprite.flip_h = true
else:
	velocity.x = 0
	
if Input.is_action_just_pressed("ui_select"):
	if is_on_floor():
		velvelociy.y = -jump_force

velocity = move_and_slide (velocity, Vector2.UP)

:bust_in_silhouette: Reply From: Mustafalou

move_and_slide()
U should let it empty.
İn godot 4 there is already a velocity component in characterbody i think. When calling this function it does the move or not if colliding.
U wrote velvelociy near the last line ?