Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | bnfgh |
extends Ship
class_name Enemy
onready var timer = get_node("Timer")
error (6,1): The method “get_node” isn’t declared in the current class.
The Ship class in my code extends KinematicBody2D, and is not attached to any actual node in the scene tree (though for what I understand that shouldn’t be a problem). The Enemy script is sitting on a KinematicBody2D node in my scene.
I checked and found out that the problem is still there for methods other than just get_node (look_at doesn’t work either).
I’ve already tried restarting Godot in case it just didn’t update everything correctly but the problem is still there.