S
SBSomething
Guest
Hey everybody! Im working on some stuff with DnD and I wanted to implement an One-Button combo system like the one in this video.
I added the code into my system and matched everything according to my sprites and assets. However, when i run the code i get this error.
Maybe someone can help me out. here is the script im using
Thanks!
I added the code into my system and matched everything according to my sprites and assets. However, when i run the code i get this error.
Code:
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object object0:
Variable object0._atk(100009, -2147483648) not set before reading it.
at gml_Object_object0_Step_0 (line 7) - if (_atk && CanAttack && ComboCount < array_length_1d(Combo))
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_object0_Step_0 (line 7)
Code:
var_atk = keyboard_check_pressed(vk_right)
if (_atk && CanAttack && ComboCount < array_length_1d(Combo))
{
switch (ComboCount)
{
case 0 :
sprite_index = Combo[ComboCount];
//spawn the collider
break;
case 1:
sprite_index= Combo[ComboCount];
break;
default: show_error("Error found in player combo", true);
}
CanAttack = !CanAttack //flip the boolean value
ComboCount ++;
image_index = 0; //reset the animation
}
Thanks!