Pull player towards camera using raycast

Godot Version v4.1.1.stable.official [bd6af8e0e]

How can I make my player character to quickly move/teleport towards the camera position when a raycast is colliding?

Because I have this orthogonal camera perspective (immitating FEZ), but I need the character to be always at the edge of the platform the camera is facing. My movement is the default one if you use a template for a CharacterBody3D.

var input_dir = Input.get_vector("a", "d", "forward", "backward")
var direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if direction and !lock_mvt:
	velocity.x = direction.x * SPEED
	velocity.z = direction.z * SPEED
else:
	velocity.x = 0
	velocity.z = 0

Also, I’m a novice. So I’m not very experimented into this, and yt tutorials don’t have what I need, so if someone knows, please help ):