grapple hook using line2d and raycasts not working

if Input.is_action_pressed(“grapple”):
raycast.target_position = get_global_mouse_position() - global_position

  if raycast.is_colliding():
  	print($RayCast2D.get_collision_point( ))
  	$RopeLine.visible = true
  	$RopeLine.set_point_position(0, Vector2.ZERO)
  	$RopeLine.set_point_position(1, raycast.get_collision_point() - get_parent().position)
  	
  
  else:
  	$RopeLine.visible = false

if Input.is_action_just_released(“grapple”):
pass

I’m trying to make a grapple hook for my game, I’m trying to get the grapple hook to stay in one position when you click. the line2d goes through the block that the raycasts detects

I’ve fixed this, but another issue im having is that the line2D moves with my character, and i cant find anything that tells me how to fix it to a point