0

how are you, night. Okey I have this.

File (Grid.gd)

class Grid:

    var gridArray : Array

    func SystemGrid(width : int, height : int):

        self.width = width
        self.height = height

        print(width+" , "+height)

I want to call the print function from another script

File (Snap.gd)

extends Node2D

    func _ready():
        
        var grid = Grid.new(2, 1)

I want to keep the readability as in C#. Give it error. Is there any way to call the class other than Preload or Load?, like in C#. Regards and thxs

1 Answers1

0

const Snap = preload("res://assets/util/Snap.gd")

if you want to just import the snap.gd into grid.gd try out this. Also, you have god a mini tutorial, hope it helps you out

https://godotengine.org/qa/63727/how-do-i-include-a-script-into-another-script