Page 1 of 1

Change Animation side effects??

PostPosted: Sun Nov 02, 2008 11:28 am
by imagremlin
I have this code to make my character jump:

Code: Select all
if (jumping != 0)
{
    yvelocity = -8;
    jumping -= 1;
}


It's on my KeyDown event (I allow for double jumps). I works perfectly. my character jumps as you would expect.

Now I want to change the character animation to a "jumping" animation. If I add this:

Code: Select all
if (jumping != 0)
{
    yvelocity = -8;
    jumping -= 1;
    ChangeAnimation("Event Actor", "s-jumpl-1", FORWARD);
}


Things start to get weird. The "jumping" animation kicks in, but the character does not move up (like yvelocity has been set back to zero). Pushing the up key twice (the second while the "jumping" animation is on) does make the character jump. I've tried different ways to achieve this with no success. I'll post my project if requested

There are more sophisticated things I'd like to do, like detecting that the character is falling and change the animation accordingly, but I'm starting on the most basic problem.

Re: Change Animation side effects??

PostPosted: Sun Nov 02, 2008 12:34 pm
by imagremlin
Please ignore my question. The problem is solved.

If anyone is interested:

My jumping animation was slightly bigger than my running animation, so when I changed it, it immediately triggered a physical reaction against the floor, stopping the jump.