J
justsomebody
Guest
I haven't touched GML in a long time, and it seems my memory is faulty.
I'm doing a simple movement system, just a prototype at the moment, but the collision doesn't seem to register how i would expect.
the code I'm using is
if !place_meeting(x+2,y,obj_stone) {x+=2}
I was under the impression that if any part of the collision masks were to overlap, this would count as a collision. Both sprites are 16 by 16 boxes, meaning that there should be at least 8 distinct positions where the collision event stops horizontal movement from top to bottom, movement always occurring in increments of 2, but for some reason collision only registers when the blocks are at identical vertical values, so... somehow, the collision is entirely ignored and passing through solid objects is allowed in every other vertical position. I've tried using several other methods, but seem to have similar problems. What am I missing? Any insight would be very helpful.
I'm doing a simple movement system, just a prototype at the moment, but the collision doesn't seem to register how i would expect.
the code I'm using is
if !place_meeting(x+2,y,obj_stone) {x+=2}
I was under the impression that if any part of the collision masks were to overlap, this would count as a collision. Both sprites are 16 by 16 boxes, meaning that there should be at least 8 distinct positions where the collision event stops horizontal movement from top to bottom, movement always occurring in increments of 2, but for some reason collision only registers when the blocks are at identical vertical values, so... somehow, the collision is entirely ignored and passing through solid objects is allowed in every other vertical position. I've tried using several other methods, but seem to have similar problems. What am I missing? Any insight would be very helpful.