Skip to reading
GDScript Programming & Godot

Troubleshooting native scripts

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Earlier edition reference / Current 0.86.4.0 property paths > p. 350

Source table from Troubleshooting native scripts, page 330
SymptomCheck
Say/Variable/Action is unknownDid an explicit extends Node replace the PCA base? Keep the inherited PCAScriptBase route.
Runtime is null in _readyPCA binds after adding the script Node. Use on_global_ready or a routed call for PCA-dependent startup.
A timer stops after run returnsThe record may be temporary. Keep a global instance or await the complete finite job.
Member values resetOrdinary records get a fresh instance each call. Use a global member for session state or Variable for saved state.
A handler never runsCheck the Event Functions subscription and exact on_* method.
A local name causes warnings/confusionAvoid hiding inherited context, Runtime, player, name or a helper method.
A proxy looks valid but the record is missingUse proxy.Exists or registry.Has; IsValid only validates the proxy object.
A child path cannot be foundThe script Node is not the calling object’s rendered Node. Inspect the correct hierarchy.
Resource load fails only in a buildThe actual resource file/import/dependencies may not be included. A record ID is not a res:// .gd file.
A visual change is overwrittenAnother controller/animation owns the property, or the write changed only a definition.
Room transition destroys the editorUse PCA ChangeScene, not SceneTree.change_scene_to_file, for adventure rooms.
A stale node fails after room changeUse is_instance_valid and reacquire the native node when the room/actor rebuilds.
TryCall did not recover an errorIt validates a Callable; it cannot catch arbitrary GDScript runtime errors.
Page 330 of 378Permalink
Go to page