Raycast Detection child of camera and Spring arm

Godot Version

4.2

Question

I have a 3d person character controller and im trying to set up interactions. But my raycast wont work if i child it to my spring arm it only works if i child it to my character collision mesh.

The camera is a child of the spring arm and the raycast is a child of the camera but i cant seem to get it to work.

Here is the code for the Interaction on the raycast

extends RayCast3D

@onready var interact_prompt_label : Label = get_node(“InteractionPrompt”)

func _process(_delta):
var object = get_collider()
interact_prompt_label.text = “”

if object and object is InteractableObject:
	if object.can_interact == false:
		return
		
	interact_prompt_label.text = "[Interact] " + object.interact_prompt
	
	if Input.is_action_just_pressed("interact"):
		object._interact()

here is my node setup
Screenshot 2024-01-11 121406

fixed it just had to increase the raycast length as the spring arm was pulling the camera back on startup

Tip: Don’t add the camera directly as the child of the spring arm, but add it as the child of a Spatial node and have that as the child of the spring arm. After that, move the camera slightly forward; that way, the camera won’t clip inside the edges or surfaces