Unique ID Node
A custom Godot node that generates a unique ID to be concatenated to, or replace the parent node's name.
Last updated
A custom Godot node that generates a unique ID to be concatenated to, or replace the parent node's name.
Last updated
This node can be added as a child of an existing node. The parent node will then have its name either concatenated with the ID or replaced by the ID.
Can generate 3 different length of unique ID: Short, Medium, Long.
Ability to concatenate the ID to parent name or replace the parent name.
Option to add a string separator when concatenating the ID.
Option to set the unique ID as persistent (saved to disk).
Automatically free this custom node after generating the unique ID.
"I was trying to search my node tree for a code-generated node, but I struggled because all the names were identical, labeled as @StaticBody@. I thought, why not retain the original name I gave each node and simply append some random characters to avoid any name clashes? And that's how the Unique ID node was born."
Here’s a video showcasing the initial development of the plugin.
After enabling this plugin, you can add the UniqueId
node as a child of another node and it will add or replace a Unique ID to the parent node.
Right-click on a node or press Ctrl+A.
Type "unique" on the Search textbox of the Create New Node form to filter the node list and easily find the UniqueId
node.
Double-click the UniqueId
node to add as a child of the node.
Adding more than one UniqueId
node will result in creating a sequence of Unique IDs. The IDs will either be concatenated or replace the parent name, which ever comes first.
Adding the UniqueId
node as the only node, or a child of the root node, will result in changing the name of the root node.
Length: The length of the unique ID to generate.
Short: When selected, the node will generate a 4 hexadecimal ID (8 characters).
Medium: When selected, the node will generate an 8 hexadecimal ID (16 characters).
Long: When selected, the node will generate a 16 hexadecimal ID in UUID format (36 characters including dash).
Separator: The string separator between the original node name and unique ID. Not used when Replace Original
is true.
Enabled: Property to enable/disable the node.
Replace Original: When enabled, the parent's name is replaced by the generated unique ID.
Persistent Id: When enabled, the unique ID is saved in disk along with the object's instance ID. The file that stores the instance ID to unique ID mapping is saved in user://persistent.ids
.
To save the unique IDs, call PersistentId.save_ids()
, preferably in the _ready
function of the root node.
To remove the unique ID from the list in the persistent.ids
file, disable the Persistent Id option.
I recommend only use persistent IDs on static nodes.
When using persistent IDs with dynamically created nodes, the plugin will always perform a save and load of unique IDs, as the node's instance ID changes each time the dynamic node is created.
The primary use-case for the plugin is to add unique IDs to defined node names, facilitating easy searching and filtering during game debugging.
Use persistence moderately, as excessive persistence can negatively impact performance.
Without using the UniqueId
node.
When using the UniqueId
node.
Easier to search and filter!