33. How to access Godot functionality
func run() -> Dictionary:
var information: Dictionary = Engine.get_version_info()
var elapsed_ms: int = Time.get_ticks_msec()
var position: Vector3 = Vector3(2, 0, -1)
return {
"godot": information.get("string", ""),
"elapsed_ms": elapsed_ms,
"distance": position.length()
}No extra import is needed for built-in Godot classes and singletons. You can call Time, Engine, Input, FileAccess, ResourceLoader, ClassDB and the normal GDScript functions directly. Class names and method names keep Godot’s case and spelling.
| You need… | Typical Godot route |
|---|---|
| A new node | Timer.new(), Label.new(), Node3D.new() |
| A delay | await get_tree().create_timer(seconds).timeout |
| A signal callback | node.signal_name.connect(callable) |
| An asset resource | load / ResourceLoader.load after checking the path |
| A new class from a file | preload or load a .gd Script, then new() |
| A native scene | load a PackedScene, then instantiate() |
| A runtime check | is_instance_valid, is, has_method, ClassDB queries |
Access to the API is not automatic integration with PCA’s saved records. A native cube you create yourself is not automatically an adventure hotspot, a saved object or a navigation obstacle. Decide which system owns it.
