• 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!

[noob question]Collision problem

V

veko

Guest
Hello, so in my platformer i have my character pushed back when shooting a machine gun
if key_right_shoot = true and !place_meeting(x+1,y,obj_wall) x -= 3;
if key_left_shoot = true and !place_meeting(x-1,y,obj_wall) x += 3;

With this player gets stuck in the wall for just a few pixels, ive tried experimenting and changing placemeeting but nothing seems to work. If you know how to solve this problem, please, help me ou!
 

TheBroman90

Member
I don't know if this is the problem, but shouldn't you be checking for collision in the same direction you're moving?

This
Code:
!place_meeting(x+1,y,obj_wall) x -= 3
Should be this
Code:
!place_meeting(x-3,y,obj_wall) x -= 3
 
Top