0 votes

When i try this code i get the error(6,1): The method "get_node" isn't declared in the current class

onready var head = get_node("Head")

I dont understand what i need to fix? I have the script connected to my player node, wich has a child node called "head", so thats not the problem.

in Engine by (12 points)

What does the rest of your script look like? Specifically, what does it extends at the top?

wich has a child node called "head"

Node-names are case-sensitive. If your child node is called "head", then you need to call get_node("head"), not get_node("Head"). If that's not the issue, you either forgot the extends-line at the top of your script or are extending something custom.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.