A
AiNaKa
Guest
I'm trying to convert the collision detection that prevents the player from falling through the floor into code. Originally, I had it set as a collision event with the collision object that would set vspeed to 0, and move to contact with said object (to prevent this issue I got with the player bouncing when landing). I tried deleting that and putting code into the step event to execute it instead so I could do more with it. I've tried 2 different blocks of code:
Neither of these work, and the player just slowly sinks through the ground. I've also tried adding "x += 1", but that messes up my animations and prevents the player from jumping. Is their anything different I should be trying here?
Code:
if collision_rectangle(x+46,y+128,x+81,y+129,tile_collision,true,false)
{
vspeed = 0;
move_contact_solid(270,-1);
}
Code:
if place_meeting(x,y+1,tile_collision)
{
vspeed = 0;
move_contact_solid(270,-1);
}