![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | abelgutierrez99 |
I understand what the error means, but I can 't see where is the problem.
So here is the main scene script:
extends Node
func _init():
var hexPlanet : HexPlanet = HexPlanet.new() # here is the error
add_child(hexPlanet)
var balls = preload("res://Assets/Auxiliar/Balls.tscn").instance()
add_child(balls)
var camera = preload("res://Assets/Cameras/CameraGimbal/CameraGimbal.tscn").instance()
add_child(camera)
The HexPlanet
script:
class_name HexPlanet
extends Spatial
var R : int = 10
var rng : RandomNumberGenerator = RandomNumberGenerator.new()
var tilesVpositions : PoolVector2Array
func _ready():
rng.randomize()
tilesVpositions = GLOBALS.hex_circle(Vector2.ZERO, R)
var tile : Tile
for i in range(tilesVpositions.size()):
tile = Tile.new(tilesVpositions[i])
#tile.change_center(MATERIALS.WHITE)
add_child(tile, true)
GLOBALS
is an autoload and Tile
is another class I created, but didn’t give me errors in the past (all pieces of code work separately). The game is executed and the result is correct, but I get the error The class 'HexPlanet' couldn't be fully loaded (script error or cyclic dependency)
I need to solve this to go further in my project.
Thanks!