Page 1 of 1

frustrating animpos glitch... =(

PostPosted: Mon Sep 17, 2007 11:10 pm
by Sgt. Sparky
there is a frustrating glitch with GE to where right after you change the animation you cannot set the animation position with the animpos varaible. :(
here is the code I am using,
Code: Select all
anim = animpos;
if(key[KEY_LEFT] == 1)
{
ChangeAnimation("Event Actor", "Heli_02Rotate3", FORWARD);
animpos = anim;
ChangeAnimationDirection("Event Actor", FORWARD);
}
if(key[KEY_RIGHT] == 1)
{
ChangeAnimation("Event Actor", "Heli_01Rotate3", FORWARD);
animpos = anim;
ChangeAnimationDirection("Event Actor", BACKWARD);
}

and yes, I am making a Helicopter Game. :D

Re: frustrating animpos glitch... =(

PostPosted: Tue Sep 18, 2007 8:38 am
by metal_pt
Well, I really don't know what you are trying to do here, but if it is what I think it is than try it this way:

Create a global:
Code: Select all
int animdir=0 //0 to left and 1 to right

Now make your code like this:
anim = animpos;
if(key[KEY_LEFT] == 1 && animdir!=0)
{
animdir=0;
ChangeAnimation("Event Actor", "Heli_02Rotate3", FORWARD);
ChangeAnimationDirection("Event Actor", STOPPED);
animpos = anim;
ChangeAnimationDirection("Event Actor", FORWARD);
}else
if(key[KEY_RIGHT] == 1 && animdir!=1)
{
animdir=1;
ChangeAnimation("Event Actor", "Heli_01Rotate3", FORWARD);
ChangeAnimationDirection("Event Actor", STOPPED);
animpos = anim;
ChangeAnimationDirection("Event Actor", BACKWARD);
}