AGJ
1
Godot Version
4.2.2
Question
Hey, i am new to Godot and im trying to create a clicker game
I’m getting “invalid get index on base nil” error in this script:
@onready var main = %MainButton
var score = main.score
and click.gd script that attached to the MainButton object contains this:
var score = 0
how can i fix that error?
you already set the MainButton unique name?
AGJ
3
yeah mine MainButton have unique name tag on it
at where do you put this line
not in _ready()?
AGJ
5
no, that line is not in _ready()
extends Button
@onready var main = %MainButton`
var score = main.score
try change it to:
@onready var score = main.score
system
Closed
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.