#Anyone know what's causing this error: "unable to find instance for object index"

1 messages · Page 1 of 1 (latest)

trail mist
#

############################################################################################
ERROR in
action number 1
of Draw Event
for object obj_battle_controller:

Unable to find instance for object index 100025
at gml_Object_obj_battle_controller_Draw_0 (line 184) - show_debug_message(active_target.x)
############################################################################################
gml_Object_obj_battle_controller_Draw_0 (line 184)

Here's my full crash log, along with a video of the crash and relevant screenshots of code!

bitter flower
#

that means that whatever instance active_target is set to doesn't exist when you try to access it

#

if active_target != noone is still true if the instance stored in the variable is destroyed, since the variable is still set to it's id even if it's destroyed

#

you'd want if instance_exists(active_target) instead for it to also work with destroyed instance

trail mist
#

awesome, that seems to have fixed it. thanks!

#

############################################################################################
ERROR in
action number 1
of Step Event0
for object obj_battle_controller:

Unable to find instance for object index 100025
at gml_Script_anon@1049@gml_Object_obj_battle_controller_Step_0 (line 35) - return _element.hp > 0;
############################################################################################
gml_Script_anon@1049@gml_Object_obj_battle_controller_Step_0 (line 35)
gml_Object_obj_battle_controller_Step_0 (line 33)

now i'm getting this error, from this line of code, looks like a similar issue
i'm destroying the instance once the target dies, seems to have caused a few big issues