0
Under review

System crashes when deleting global varible and pressing ctrl-z

dyrwoolf 8 months ago in Game Creator updated by Marti (Lead Developer) 8 months ago 4

I deleted an varible in Game Creator Prefernces window and then regretted the deletion and pressed ctrl-z.
(The varible i deleted was the first at index 0.)
After this the system broke down.  


I tried to reinstall the Game Creator system but still nullrefernces and the GCP window was blank like above.


Unity version:
2018.4.12f1
Game Creator version:
1.5
Under review

Ctrl-Z has always been a pain. We'll open a ticket and have a look at this. Thanks for the report! I'll circle back when I have more info on the subject.

I could solve it by forcing the functions to ignore position (index) 0. This led to that i could see the vaibles in the window again, and then delete the first one (whith was null-something). After this i could undo the code and all worked again. I think You could easilly prevent this by doing a try-catch in the functions, that prevent it from crashing.

The problem is that when a variable is created, we create a Scriptable Object that holds the variable's information. Ctrl+Z destroys that scriptable object but because of a problem with grouping multiple steps, the array of global variables still has the slot of that global variable. But because the scriptable object no longer exists, it throws this error.

A simple null check should do the trick, although we'd like to investigate this in a deeper level. Thanks once more!

Hi Dyrwoolf. I'm currently trying to reproduce this but everything works fine on my end. Do you happen to have the image you posted without the frontal window? Otherwise we can't see the line number throwing the error.

Could you confirm that you are on Game Creator 1.0.5? We clicked on the "+" sign to create a new variable, Ctrl+Z and the variable simply disappeared. If you can provide clear reproduction steps, this would help us a lot!

Thanks!