Generate ID number for each object

If i have for example10 same object, how i can generate different ID number for each?. I try do save system, when next time back to level, there is all object which not collect in correct place.

  1. Add a “For Each Object” Event.
  2. Select your object.
  3. Add a “Trigger Once” condition.
  4. For the action, add a “Modify scene variable” action. Variable name “ObjectNameHereIDCount”. Add 1
  5. Add another action, with the “modify object variable” action. Set the variable name to “ID”. Set the value to Variable(ObjectnamehereIDCount)

Thanks!!. It work. Now i can write and read, but problem is now how create objects that specific place when level start and delete another.kuva_2020-11-09_104136


This works, but if you have lot of objects, it do lot of work. Any better idea?

The “level editor” example included with GDevelop show you how to do this:

1 Like

Thank you ddabrahim!! There it is.