slicky-grease
Member
I have this problem with my code. I have my boss character to chase my player before attacking, but when it put the state = boss5_giant.chase in the function itself, the boss isn't following the player. It works as intended when I take out that code. I wonder what the issue might be.
GML:
function scr_boss5giant_idle(){
hsp = 0
timer += 1
if timer >= timer_max
{
timer = 0
state = choose(boss5_giant.chase_enter)
}
}
GML:
function scr_boss5giant_chase_enter(){
if distance_to_object(obj_flare) > 5
{
dir = sign(obj_flare.x - x);
hsp = dir * walkspd;
vsp = vsp + grv;
state = boss5_giant.chase
}
}
GML:
function scr_boss5giant_chase(){
slam_timer += 1
if slam_timer >= slam_timer_max
{
timer = 0
hsp = 0
state = boss5_giant.slam_anticipation
}
}