why wont it print the wall when the ray cast hits my wall

Godot Version

godot 4

Question

why wont it print the wall when the ray cast hits my wall
extends RayCast3D
func _ready() → void:
var wall = get_node(“wall 1”)

func _physics_process(delta: float) → void:
if is_colliding():
var hit = get_collider()
if $“walll 1”:
print(hit.name)
pass
pass

Is your “walll 1” a child of the ray cast? Do you get any errors?

Also, one time you’re spelling “wall 1” and then second time “walll 1”, which makes a difference for the engine. Make sure you’re spelling it correctly.

Also, this piece of code I think you meant to be checking if ray cast hit the wall?
All it does currently is checking if you have a “walll 1” node in the scene.

if $“walll 1”:
    print(hit.name)

You need to do a comparison to make this make sense. E.g.

if hit == $“walll 1”:
    print(hit.name)