Hopscotch has a very unreliable scene duplication system.
When you duplicate a scene, each and every single object in the duplicate gets renamed, BUT — if you were to reference an object in a script (i.e. Object A X Position) the reference would not get updated, therefore you would be trying to get an attribute for an object that does not exist on this scene.
If you do not understand, whenever you duplicate a scene, all objects in the copy get renamed:
i.e. Object A becomes Object A 2
BUT if you were to reference Object A in a script in the original scene, it would still point at Object A in the copy, not Object A 2 like it should.
I have two solutions:
Do not rename the objects (I consider this a good idea because having everything have a 2 at the end may look unsatisfactory).
Update the references too.
Hopscotch Team, please bring your attention to this since this bug has enough power to slow down development by a lot.
yes, email would be the most efficient option. if you want more information, contact @/yuanyuan or @/t1. but I recommend email. try to avoid tagging leaders - especially all of them, because most of them don’t have control over bugs.
This wouldn’t work because all of objects’ names in the project must be unique to each other (that’s even if they’re in different scenes).
Deleted objects also count (which means you cannot use the name “Text” even if you deleted the object with the name “Text”, which might be another bug).
But can’t it just have an ID for each object and rely on those? Like in Roblox: you can name everything the same way if you want to, and it won’t stop you, since an Instance.Name is not a unique identifier.
yes, but how other way is there? it seems ID would be most efficient, unless someone can come up with something else. the numerical method with duplication is less efficient and troublesome, but the next best choice.
What do you mean?
It could for like this:
When a scene is duplicated, load the copy
Afterwards, create a table with old IDs as the keys, and the new IDs as the values.
Then, go through each and every single instance of an ID type value in the project and replace the old IDs with the new ones using the table.
lol, maybe for YOU WIN and YOU LOSE, that show the same data besides the message.
my overall solution is to not use scenes, using variables to represent scenes or transitions are smoother, more satisfying and more efficient.
but more difficult.
Then why were scenes added? To make coding easier. There is a reason why I would like to use scenes, and issues which interfere with coding or creativity, or issues that slow coding down should be dealt with if they look like a bug and it would not hurt any principles if THT were to fix it.
That’s right, more difficult.
This is why I want to use scenes.
I have a project where having scenes work as intended is important, and besides, what would it hurt if Hopscotch used an ID system for objects?