Master Cabalist
Member
Hi I have a line of code in my animation end
spit_inst = instance_create_depth(x+60, y+60, -12000, Snowball);
This is the error mesage:
I declared spit_inst in the create event but it still gives that error?
GML:
var currSpriteAnimName = sprite_get_name(sprite_index);
show_debug_message("Expecting Sprite Id: " + string(asset_get_index("SnowBatAttack")));
show_debug_message("Sprite Animation Ended: " + string(sprite_index) + ", " + currSpriteAnimName);
if (sprite_index == SnowBatAttack)
{
sprite_index = SnowBatAttack;
show_debug_message("Animation End. Creating snowball");
spit_inst = instance_create_depth(x+60, y+60, -12000, Snowball);
spit_inst.source_x = x-20;
spit_inst.source_y = y-20;
spit_inst.t_x = t_x;
spit_inst.t_y = t_y;
sprite_index = SnowBatStill
}
if (sprite_index == FrankensteinMonsterSendOutBrains)
{
sprite_index = FrankMonsterIdle;
}
This is the error mesage:
Code:
___________________________________________
############################################################################################
ERROR in
action number 1
of Other Event: Animation End
for object SnowBatObject:
Creating instance for non-existing object: 623
at gml_Object_SnowBatObject_Other_7 (line 12) - spit_inst = instance_create_depth(x+60, y+60, -12000, Snowball);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_SnowBatObject_Other_7 (line 12)