Godot 4: 3D Cards fanning

Godot 4.2.1

I just started working with 3d this week, and I thought a good exercise would be to recreate some 3d game as practice. I chose Inscryption.

The problem is with the card fanning. I don’t know exactly the problem but you see the gap between the cards, thats the problem. I want the cards to be centered with the hand_ratio but the cards just go to the far end.

(Video)

(ScreenShot)

(Code)

func organize_cards():

	for card in $Cards.get_children():
		var hand_ratio = 0.5
		var destination = $Cards.position
		var camera = get_viewport().get_camera_3d()
		
		if $Cards.get_child_count() > 1:
			hand_ratio = float(card.get_index()) / float($Cards.get_child_count() - 1) 
			
		destination.y = $Cards.position.x + spacing_curve.sample(hand_ratio) * 2.0
		
		destination.z = height_curve.sample(hand_ratio) * camera.basis.z.y
		
		card.position = destination