Skip to content

A custom node that generates a unique ID to be added to or replace the node's name.

License

Notifications You must be signed in to change notification settings

JBSnippets/godot4-unique-id

Repository files navigation

Unique ID node ~ Godot 4+

A custom Godot 4+ 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 use.

💽 Supported Versions

📥 Installing the Plugin

Install using Godot's AssetLib

  1. Go to the AssetLib in the Godot Editor.
  2. Type "unique" to search for the UniqueId node.
  3. Select the asset and click Download.

Install with examples

  • Download as a ZIP file from this repository or
  • Clone this repository

🚀 How to use

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.

  1. Right-click on a node or press Ctrl+A.

Add Node

  1. Type "unique" on the Search textbox of the Create New Node form to filter the node list and easily find the UniqueId node.

Add Node

  1. Double-click the UniqueId node to add as a child of the node.

Add Node

📺 Video on How I created and use the plugin.

Watch the video

📝 Notes

  • 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.

📡 More Plugins!

Head on over to my website at https://plugins.jbsnippets.com to read more about this plugin and other plugins that I've been creating during my game development journey.

About

A custom node that generates a unique ID to be added to or replace the node's name.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published