Why my script is not working?

Godot Version

4.2

Question

Why my script is not working when i click “v” it will spawning enemy

###script:

> extends Camera3D
> 
> @onready var ray = $RayCast3D
> var object_scene = preload("res://enemy.tscn")
> 
> func _physics_process(delta):
> 	if ray.is_colliding():
> 		var intersection_point = ray.get_collision_point()
> 		spawn_object(intersection_point)
> 
> func spawn_object(position):
> 	var new_object = object_scene.instantiate()
> 	new_object.global_transform.origin = position
> 	add_child(new_object)

What does it say?

It’s don’t say anything, it’s not working

Try to print the position the ray intersects at and also try to spawn the enemy in a different node. not the camera