Change Animation side effects??

Talk about making games.

Change Animation side effects??

Postby imagremlin » Sun Nov 02, 2008 11:28 am

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.
imagremlin
 
Posts: 15
Joined: Wed Oct 29, 2008 7:16 am
Score: 0 Give a positive score

Re: Change Animation side effects??

Postby imagremlin » Sun Nov 02, 2008 12:34 pm

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.
imagremlin
 
Posts: 15
Joined: Wed Oct 29, 2008 7:16 am
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron