This won’t work, all the prefabs will have the latest ID, that is if you change the prefab ID then all instantiated objects get it as well.
In my test I have an ID variable in the prefab code, I have a counter in the main game code, every time I instantiate I increment the counter, before I instantiate a new prefab I set the prefab ID to the counter.
But when I look at the prefab ID it’s incrementing all the time as each new instantiate happens.
I’m looking for exactly the same solution…I’ll post here when I find it!
Ok so here it is!
Works perfectly for me, I now have all prefabs with unique IDs.