sprite gets stuck in wall

hey guys, while i was trying to figure out my jump sprite i decided to try and copy paste someones code, it helped with the jump sprite, but when when the character spawns, it falls down and lands in the middle of the wall and i cannot jump or move.

i took out tiny areas of code and this is the spot that, when i remove it, allows the character to stand on top of the wall (not inside it) , but the character cannot move unless you jump and then press an arrow control, it also got rid of the jump sprite

if !place_meeting(x,y+2,oWall) {
sprite_index = sPlayerA
}else {

if ( direction == 0 ) {
sprite_index = sPlayer;
}
if ( direction == 180 ) {
sprite_index = sPlayer;
}
}

(sPlayerA is the sprite for jump, sPlayer is idle, oWall is the wall object)

i don't know if this is a simple fix or i messed something up, oh well.
 

TheouAegis

Member
It should be y+1. And your sprite origin-bbox_bottom ratios are off. Your sPlayerA's origin is closer to the bottom of the mask than sPlayer's origin.
 
It should be y+1. And your sprite origin-bbox_bottom ratios are off. Your sPlayerA's origin is closer to the bottom of the mask than sPlayer's origin.
i fixed the origin once again and now it works :/ there was also some error in my code so i just rewrote it. thanks!
 
Top