Drag and Shooting

Godot 4.2.1

Hello Everyone i need to us help i writed a code for drag and shooting but i have some missing im only created click and shooting but i don’t know how is it working there is code

extends character Body
var speed = 100
@onready var line_2d = $Line2D

func _process(delta):
var dic = (global_position -
if Input.is_action_pressed(“ui_accept”):
line_2d.points = [Vector2.ZERO, get_local_mouse_position()]
if [Input.is_action_just_pressed(“ui_accept”):
velocity = dic * speed