Q
Quantum_Compooter
Guest
My player character is having problems with approaching my "wall" objects. As he gets closer to them he starts to blink and spazz out and then gets stuck inside the box and disappears.
Here is the code I am using for the collision
I have vertical collisions set up using the exact same code just reverse for vertical. It seems to me that my player character can still move forward with the key pressed down when he should not be since I am setting hz_mv to 0. But like I said he flashes in and out when approaching the collision cube can get stuck and disappear in the cube but can walk back out and be fine if he gets away from it.
Here is the code I am using for the collision
Code:
if(place_meeting(x+hz_mv,y,oWall)){
while(!place_meeting(x+sign(hz_mv),y,oWall)){
x = x + sign(hz_mv);
}
hz_mv = 0;
}