Unique ID Node
A custom Godot node that generates a unique ID to be concatenated to, or replace the parent node's name.
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.
Features
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.
How the idea started
"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.
How to use
Adding the Node
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.
Adding a new node Type "unique" on the Search textbox of the Create New Node form to filter the node list and easily find the
UniqueId
node.Searching the UniqueId node Double-click the
UniqueId
node to add as a child of the node.UniquId node as a child node
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.
Variables in Inspector
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
.
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.
Examples
Without using the UniqueId
node.

When using the UniqueId
node.

Easier to search and filter!

More Screenshots


Last updated