0 votes

I wanted to add a singleton called "global.gd". Added it to the autoload tab, but when i run my game i get this error:

"Parser Error: Script not fully loaded (cyclic preload?) : res://scenes/global.gd"

I don't know why, here's the code thats inside the global script

extends "res://scenes/global.gd"
func _ready():
    var clicks = 0;

If i write this variable outside the ready function it happens the same thing

in Engine by (399 points)

1 Answer

+1 vote
Best answer

Looks like You have a script that inherits itself. Try inheriting Node:

extends Node


func _ready():
    var clicks = 0
by (2,264 points)
selected by
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.