

It's difficult enough as it is to make sure you don't make errors and mistakes, but when you end up spending endless hours on game engine errors that may or may not happen at random intervals, it eats up any credibility the engine might have. I don't know what to say, this is something that should not happen when programming. The variables are not only mentioned in the object itself, but in the same event, and also the variables are initialized long before they are even read. If I however plant it into the same event with other variables, it does work. If I plant the script into a separate event, this time around it does not work. However if I copy/paste the text from the script to object2 it does not work. Just to add to this, if I remove the script from object1 and copy paste what is in the script into it, it works good. And this particular variable is exactly the same as in object1. When object2 tries to run the same script, it says the variable doesn't exist, when it does. In object1, the script even runs first, and is successful. The items are literally copies of one another, except for what the variables are. I have the exact same script run on two separate objects.


There may be some code-cache-stuffs that even cleaning the project cache won't reset.
#Gamemaker whenever object runs script it deletes code#
and then the rectangle started drawing correctly, despite the GML code being the exact same as before.Īs such, I believe you when you say " the code worked when copied and pasted without edits". The second of these lines didn't work as expected, producing a much taller rectangle than it should, even if I cleaned the temporary project cache before building the game again.Īfter much troubleshooting to no avail, I copied the first line, pasted it above the second line, (increased the numbers if I had to,) double- and triple-checked that the newly-pasted line was completely identical to the old second line (which it was, character by character), deleted the old second line, ran it. For what it's worth, I've previously experienced having two lines of code a little next to each other (both of them in the same GML action) that were either completely identical or identical safe for two numbers that I increased, to draw two rectangles. Originally posted by LawH:- and voilá, it started working with the exact same code.
