Unexpected "extends" in class body

extends CharacterBody2D

var direction : Vector2 = Vector2.ZERO
var attack : bool = false

@onready var animation_tree = $AnimationTree

func _physics_process(_delta):
if not swing:
velocity = direction * 75
else:
velocity = Vector2.ZERO
move_and_slide()

func _process(_delta):
direction = Input.get_vector(“ui_left”,“ui_right”,“ui_up”,“ui_down”)

if direction != Vector2.ZERO and not swing:
	set_walking(true)
	update_blend_position()
else:
	set_walking(false)

if Input.is_action_just_pressed("swing"):
	set_swing(true)

func set_swing(value = false):
swing = value
animation_tree[“parameters/conditions/swing”] = value

func set_walking(value):
animation_tree[“parameters/conditions/is_walking”] = value
animation_tree[“parameters/conditions/idle”] = not value

func update_blend_position():
animation_tree[“parameters/attack/blend_position”] = direction
animation_tree[“parameters/idle/blend_position”] = direction
animation_tree[“parameters/walk/blend_position”] = directi

im not sure what is causing this, but it could be outdated code that doesnt work with godot 4

Your problem is poorly explained and your initial post is not correctly formatted.

Please explain your problem, in detail, and provide visual aids for the context of your problem. (such as images of your compiler error).

Maybe if you put a “class_name” that would, effectively, extends CharacterBody2D, that would help.