function "get_colliider()" not found in base self.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By turtilla955

here is my code:

if $Camera3D/RayCast3D.is_colliding() and Input.is_action_pressed("shoot"):
		var selected = get_collider()
		if selected is enemy:
			print("working")

i have checked that i have a class named “enemy” in a different node and that all the names are right, so im geussing that it is a problem with the get_collider function

:bust_in_silhouette: Reply From: JCJL

The function get_collider() alone is referring to the base node the script is on, not sure if its Camera3D or another, so maybe try doing $Camera3D/RayCast3D.get_collider() so it knows it has to get the collider of the raycast.

i dont get an error anymore but it doesnot print, anything i could do to fix that?

turtilla955 | 2023-04-15 19:02