Auto Incrementing a property value in the editor

Is there any way to auto increment a value such that whenever a game object is dropped into a collection in the editor, it’s value to go up by 1.

The specific use case I have is for the library extension I created for Defold called NavGo. I have recently added in a new type of directional node that essentially creates a linked list by having an ID that must be unique and a “nextID” that the node points towards. Currently, the user has to manually set all of the ID’s in the editor. This isn’t horribly fun and I think there should be some sort of way to auto increment the property so that the user doesn’t have to do it.

During runtime, this wouldn’t be an issue. I could just create a singleton and increase it, however, I need the IDs to be consistent and user definable, but giving it an initial temporary value that automatically auto increments would be perfect.

Does anyone know how to do this or if it is even possible?

Thanks!

2 Likes

A solution profits me too! :wink: