Added jumping animation and I cant move

I added:
Code:
//Animation
if (!place_meeting(x,y+1,ocity)){
    
    sprite_index = judyjump;
    
}
else{
    if (hsp == 0){
        sprite_index = judystand;
        
    }
        else{
        sprite_index = judyrun;
    }
}
and now my character (judy) wont move. Her running animation happens when I press the keys to move. I also can jump around the room but she cant walk around because when she is on any collision box she dosent walk. When I was trying to figure it out I took the:
Code:
if (!place_meeting(x,y+1,ocity)){
    
    sprite_index = judyjump;
    
}
else{}
out and it worked. So all I know is that the above code is messing with the movement
 
I'm guessing that you have some code somewhere that is using the sprite_index to figure out what to do, and that code is getting thrown off with your new code.
 

Bentley

Member
Try using a mask. It's easy to get stuck in a wall without one.
Ex: If you're against a wall, your sprite_index is idle, and you walk changing your sprite index to walk.
If spr_judy_walk has a bigger sprite collision mask than spr_judy_idle, part of you will be in the wall.
 
Top