In the current game I am creating I want to make it so when the raycast is touching an enemy and you left click, it does damage.
I see 2 errors for my code
identifier "raycast" not declared in current scope
node not found "raycast3d" relative to root/node3d
`var health = 100
func _ready():
var raycast = get_parent().get_node("/player/head/Camera3D/RayCast3D")
func _physics_process(delta):
if Input.is_action_just_pressed("click") and raycast.is_colliding():
health -= 10
if health <= 0:
queue_free()`