frustrating animpos glitch... =(

Non-platform specific questions.

frustrating animpos glitch... =(

Postby Sgt. Sparky » Mon Sep 17, 2007 11:10 pm

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
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Re: frustrating animpos glitch... =(

Postby metal_pt » Tue Sep 18, 2007 8:38 am

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);
}
]v[eta[_ - Using GE since June, 15 2007
Currently using v1.3.8 Registered
metal_pt
 
Posts: 117
Joined: Sat Jun 16, 2007 12:57 pm
Location: Sintra, Portugal
Score: 2 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron