You can pass instances around directly, so you generally don't need UIDs. If you have already got an instance reference, you can just keep using it, there's no need to loop through all instances.
I'm still making the same point: you need to think about scripting with a different approach.
You can't save instances to storage though, so I guess you need UIDs for that. I'll look in to adding a scripting method to get an instance by its UID, but as I keep repeating, this isn't something you should need for general purpose code. I am sure there are pure JS engines out there that do not use anything like UIDs at all. You can go a long way without them in code.
Awesome!!! Thanks very much for adding it, that will be really helpful at least jus to work with Construct as we been doing till now, I fully understand now that normally they don't use UID in js and I should always look to try to learn how to work without UIDs as that is how they work on real programing as you try to advise me and I thank you for the advice and showing us the right way for js programing. I will keep it in mind as I would like to code in the right way, but for now they UID when you added, is gonna be really helpful as we got used to it so at least we can start experimenting with js with something that we are already familiar with to keep going then slowly learn how to properly code and hopefully in the future once we get more experience we can slowly get rid of the UIDs.
Unfortunately, I cannot see now the difference as I'm very new but hopefully I will see what you mean in the future as I learn.
I'm glad that we finally understand each other )))))
Thanks a lot for your help and Time