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

GameMaker Character is colliding with nothing?

P

Pontereika

Guest
Not sure if this is the right place to post this, but i've just started learning game maker and have run into an issue i have no idea how to fix, my character seems to be offset to the stage and the actual hit box locations of the walls are offset so it looks like they run into nothing or that they pass right through the walls at some points, all the collision is still there its just not lining up with the visual of the walls. has anyone heard of this problem?

Screen Shot 2019-08-12 at 8.01.24 PM.pngthis is my character in the actual editor.
Screen Shot 2019-08-12 at 8.01.35 PM.png this is what it looks like when i start the game.

my code
Screen Shot 2019-08-12 at 8.02.28 PM.png Screen Shot 2019-08-12 at 8.02.36 PM.png Screen Shot 2019-08-12 at 8.02.44 PM.png
 

Mert

Member
This is because your sprite's collision shape. Set your sprite's collision shape as precise
 
P

Pontereika

Guest
So this didn't actually solve my problem BUT i did figure it out while doing this! i set it to precise like you said and it didn't work, but then occurred to me that it was switching to a different sprite when the game started cause i was programming a jump animation, so i went to THAT sprite and went to set it to precise when i saw it actually wasn't centered in the middle when my main sprite is, so i centered it and that fix it. Thanks for your advice i didn't even know you could make precise hit-boxes so ill probably use those from now on :D
 
S

SamBean

Guest
So this didn't actually solve my problem BUT i did figure it out while doing this! i set it to precise like you said and it didn't work, but then occurred to me that it was switching to a different sprite when the game started cause i was programming a jump animation, so i went to THAT sprite and went to set it to precise when i saw it actually wasn't centered in the middle when my main sprite is, so i centered it and that fix it. Thanks for your advice i didn't even know you could make precise hit-boxes so ill probably use those from now on :D
This fixed my issue, thanks! My player had been teleporting into the floor every time they ran.
 
Top