Guide to the Godot game engine/Programming/GDScript/Making nodes

Making new nodes can be easy or hard, depending on the planned node. Some will just require this guide, some will benefit from being introduced with an entire plugin. This guide will assume the former.

Write this code:

The  tells the engine to run   whenever you try to change. In this particular example, you cannot empty it. Because of the, this runs even if you change the value in the inspector.

The  tells the engine to add the script to the add node popup, add it to the auto-correction list and to allow you to instance it with.