B
Brandon Gale
Guest
Hey, can someone help me to check if a variable exists?
Here is my code:
I have a loop that loops through all instances of objects in a room and I'm trying to make sure they all have this variable (even if it is not being used) so that I don't hit an error.
Somehow the code is not doing its job and objects are still hitting an error when they have not been previously assigned the variable.
Any ideas why? Let me know if more of my code is needed here.
Here is my code:
Code:
if !variable_instance_exists(enemy[i], enemy_pos_x) enemy_pos_x = 0;
Somehow the code is not doing its job and objects are still hitting an error when they have not been previously assigned the variable.
Any ideas why? Let me know if more of my code is needed here.