Hey, So any global object won’t update it’s changes in the preview unless you reset the preview or have a button that resets the scene.
Which is very annoying and makes working slower…
The problem:
1- Open up a preview of a game that has a global object in the scene editor
2- change the position of that object in the scene editor
3- click update preview
4- changes in position won’t appear in the preview unless you restart it or have a button that says go to that scene…
So what’s up with that?
Is it a bug? something intentional in GD?
Waiting for any help on this…
The real question would be:
How make a global object update in the preview without restarting it or restarting the scene?
Updating the preview isn’t retroactive. In other words, it doesn’t change anything that already happened. The object was already spawned so updating will not do anything. On the other hand if you had some event that spawns an object at 0,0, then you change it to 200,200 and update, and the event is triggered after the update then you will see it at 200,200
I was really skeptical about this because there shouldn’t be any difference with global and regular objects once they’re added to a scene but there is.
I stacked 2 objects of each type so I could track the original positions. G for global. S for scene. I then moved one of the objects. Moving the scene object and then clicking the reload button updated the regular object only.
Keith…Just out of curiosity…since you’re testing…
could you repeat the test using the dedicated OnSceneHotReloaded` inside a custom object?..we may able to track when it happen…
@Keith_1357 Yes thank you
That’s exactly what’s happening and I have no idea why, it’s just a simple position change yet it doesn’t update in the preview.
Thank you for explaining the issue so well
I hope you find a solution for this…
I guess you could create a global and scene custom control and see if the OnSceneHotReloaded` is being triggered for both. It’s just really weird because I always assumed the objects were identical once added to a scene.
OK. I made a simple custom object with a text object. I added an 'OnSceneHotReloaded` function that added “Hot Reloaded” to it. I duplicated the extension and then made the copy’s object global.
It appears that global objects aren’t being reloaded. The global is on the left. This is after a reload.
Note that in certain rare cases, GDevelop will be unable to apply your changes to the preview. In this case, a dialog will ask you to close the preview and launch a new one from the beginning.
But it doesn’t mention any difference between global vs scene objects. And it sounds like you didn’t see that dialog anyway
I just wanted to update everyone here that this is indeed was a very hidden bug for a long time and I got in touch with 4ian and it’s officially fixed in version 5.6.266
I want to thank 4ian and the team for fixing this issue, makes working a lot faster and snappier.