Masstertron
Member
Hi folks!
I've come across a peculiar problem that I've been able to replicate in a simple test project, and I'm posting about it here to see if anyone else has had the issue, and discuss if it's a more serious issue I should post a bug report about.
Or maybe I'm a bone head and it's somehow expected behaviour!
When destroying, recreating, then passing an object index into a function, my operations on the object are not performed.
Here is the code I have where a white triangle is created when the room opens, and it turns red when you press spacebar.
In example 1, the triangle does not turn red, but in example 2 it does because I use instance_find() instead of trying to call the object index itself.
However, example 3 DOES work when I use the same technique as example 1, but I avoid the use of functions.
It's important to note that this issue only happens when there is no time in between the destruction and recreation of the object.
Also important to note is that I'm only ever expecting there to be one instance of Object2, so using the object index to perform changes on the instance is safe.
Not sure if I'm going crazy and I've done something silly.
Windows 10
IDE 2.3.3.574
Runtime 2.3.3.437
I've come across a peculiar problem that I've been able to replicate in a simple test project, and I'm posting about it here to see if anyone else has had the issue, and discuss if it's a more serious issue I should post a bug report about.
Or maybe I'm a bone head and it's somehow expected behaviour!
When destroying, recreating, then passing an object index into a function, my operations on the object are not performed.
Here is the code I have where a white triangle is created when the room opens, and it turns red when you press spacebar.
In example 1, the triangle does not turn red, but in example 2 it does because I use instance_find() instead of trying to call the object index itself.
However, example 3 DOES work when I use the same technique as example 1, but I avoid the use of functions.
It's important to note that this issue only happens when there is no time in between the destruction and recreation of the object.
Also important to note is that I'm only ever expecting there to be one instance of Object2, so using the object index to perform changes on the instance is safe.
Not sure if I'm going crazy and I've done something silly.
Windows 10
IDE 2.3.3.574
Runtime 2.3.3.437
Attachments
-
98.5 KB Views: 13
Last edited: