Hi
i am following code with tom tutorial about fps
in his video he use raycast.is_colliding methode but when i used it an error show up
i think the error meant the method has been deleted
what is the solution plz?
is_colliding
devastatingT1999 in his video he use raycast.is_colliding methode but when i used it an error show up
i think the error meant the method has been deleted
what is the solution plz?
Copy and paste the error line here. When asking for help always provide as much detail as you can for best effect and feedback.
Megalomaniak
thank you for replying
devastatingT1999 It's complaining because raycast is currently a string, or text, and doesn't have the function is_colliding() inside of it. Maybe somewhere else you set raycast equal to a string variable?
Erich_L
this is the whole script can point to the problem ?
- Edited
Change this line:
onready var raycast = "../head/camera/RayCast"
to this:
onready var raycast = $"../head/camera/RayCast"
The original is making raycast be a string containing the path. The dollar sign makes Godot look for the node specified by the path and put that in raycast.
(You can also do onready var raycast = get_node("../head/camera/RayCast") the dollar sign is a shortcut for get_node)
Kojack
thanks it worked
just forgetting one sign caused a gigantic problem