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

my character likes going through blocks?!?!

Z

zielach

Guest
im doing a drag and drop platformer
i have tried nearly everything but i think the solution should be easier than i think
only one kind of block really works.. my character just wont collide with the rest of blocks
when i press right for example it gets inside the block and then i cant get out.. i think its because it doesnt check always for collision but i tried doing that on step and it wouldnt move when i touch a block.
i have spent like 3 days with the same problem so i would appreciate some help
 

Mr Magnus

Viking King
just embrace the fact he wants to be stuck! He does what he likes!

Joke aside. you'll have to provide us with some form of code or screenshots before we can help unfortunately. as much as we like to think we are we can't read minds to see what is happening.
 
J

jackhigh24

Guest
i think its because it doesnt check always for collision but i tried doing that on step and it wouldnt move when i touch a block.
this bit you tried in a step do it again and add the speed your moving to the check, so if if going right then x+hspd or what ever your using for your speed, if going left x-hspd,
 
T

The Green Dev

Guest
You should either show us pictures of the d&d or start using gml.
 

fawf

Member
If you're getting stuck in a block then there's probably something wrong with your collision checking, or there's something else affecting the motion of the character, like the speed variable.

Check if the 'place is collision free' blocks have the correct values. (if you're jumping +10 pixels, you need to check if the position is free +10 pixels. Likewise, when going left you need to check -10)

If you are using speed and direction, then you might be able to fix it by adding the hspeed variable to your 'place is collision free' blocks. eg,

10+hspeed

-10+hspeed
 
Z

zielach

Guest
thanks that fixed it but
meanwhile i was trying to fix it i broke more stuff
ill see if i can fix it or ill just do another post if i cant

EDIT: btw now it just enters from above
 

TheouAegis

Member
For future reference, click the Object Information or Show Information (I forgot which wording GM uses) button to show all of the object's code, then copy-paste that info to here. It's better than D&D screenshots.
 
M

Morumotto

Guest
I've had similar issues before, I've fixed it by checking collision and offsetting the the collision by a few pixels from the object it's colliding with in all directions instead of having collision checked right as objects are touching each other. If done right the objects still look as if they are touching but the collision check starts way sooner which stops the player from moving.
 
Top