Is instantiating new object using class_name differs from preload() and load() functions?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Robotex

I register class name with class_name keyword

extends Object
class_name MyClass

And than inside other script I instantiate it like that

var obj =

Is it differs from that methods?

var MyClass = preload("")
var obj =


var MyClass = load("")
var obj =

If I instantiate object using registered class_name, will be script loaded during runtime or during compilation time?

:bust_in_silhouette: Reply From: klaas

you can read about it here:

  • Named scripts are registered globaly on startup.
  • Preloaded scripts are loaded into a var or const in a class on compile time. They are not globaly accessable.
  • Loaded scripts are loaded on runtime into a class variable. They are not globaly accessable.

So, will it be loaded before runtime?

Robotex | 2020-08-20 05:31