Carloskhard
Member
So I have this code in an object which tries to destroy other object when it collides with it.
The code is the following("colliding" is a local variable):
and in the debug I can see the ID of the object is correct,but on the error message it shows this:
why is saying the object was "-4" if clearly the objects was something like "100045"?
I've also tried this:
but the same fail happened.
However if I write this:
then it works nice.
Do someone understand what is happening?Because the strangest thing is that this inly happen with some objects of the same kind.
I really need to understand why this donesn't work
Thanks!
The code is the following("colliding" is a local variable):
Code:
with (colliding){
show_debug_message(colliding)
instance_destroy();
}
Code:
Pop :: Execution Error - Variable references invalid object (-4).<unknown variable>
I've also tried this:
Code:
with(colliding)instance_destroy(colliding);
However if I write this:
Code:
instance_destroy(colliding);
Do someone understand what is happening?Because the strangest thing is that this inly happen with some objects of the same kind.
I really need to understand why this donesn't work
Thanks!
Last edited: