• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Stuck in the air while doing something

R

RayLemun

Guest
So I made my player to do an attack animation while being in the air and pressing C, but my character seem to stays in the air while the animation is happening, how do I make it to fall down while the animation is going on, to make it more like a leap attack?
Here's my code and I use the instance_change for this one..

Inside the player's step event..
Code:
//Leap attack
if (vsp < 0) && (keyboard_check(ord("C")))
{
    image_speed = .2;
    instance_change(obj_player_attack_air,false);
}
If there any more details needed, pls do tell me! It's my first post here and I'm still a newbie..
 
A

Aura

Guest
If you are changing the instance then the mechanics of the original instance won't work for it. If you had set up gravity for the main player object only then it won't work for the attacking player object, so you'd have to program it for the latter as well.
 
R

RayLemun

Guest
Pretty much just put the gravity code in the attacking player object Step event? or is there some steps I'm missing here..
 
Last edited by a moderator:
A

Aura

Guest
Gravity has to be handled the same way everywhere. No exceptions.
 
Top