Hi,
I am trying to port my little game to Godot 4 (4.1.1), from Godot 3.5.2. In the 3 version, I have 'LogicManager.gd' script that contains non visual logic... management. In my Main.gd, I initialized it:

Main.gd:
func _ready():
. $LogicManager.setup(self,...)

and called its methods or variable member with

$LogicManager._curves
...
$LogicManager.startShuttle()

Now, with Godot 4, every time I try to call a function or a variable from $LogicManager, program stop and following error show up:

Invalid call. Nonexistent function 'startShuttle' in base 'Node'

It seems that the runtime can't recognize $LogicManager as custom 'Node' class

I have tried with class:

(LogicManager.gd)
extend Node
class LogicManager:
...

But I can't instantiate it in Main.gd

$LogicManager.new(self,...)

or

var _logic = preload("res://LogicManager.gd")
...
var x = _logic.new(self,...)

does not work. Instance seems to be always of 'Node' type

Any Idea to help me ?

'class_name LogicManager' at the top of the gd file is probably all you're missing

"class" is for internal classes

It works with class_name, I didn't know the internal class trick. Now, I can use the class in main.gd with:

var LogicManager = preload("res://LogicManager.gd")
var _logic

as variables in the top section, and then,

func_ready():
_logic = LogicManager.new(self,...)
...

And finally use it with '_logic' variable in main functions. Is there any more straightforward manner to have an instance of 'LogicManager' class ?
Anyway, many thanks for the help