EDIT: The answer is because one place_meeting will freeze your character if one of any of the two sides collides. In other words, if your character moves horizontally and hits a floor it will stop moving completely, but if you separate the place_meeting you can still move horizontally.
This is even more evident when making a 2D platformer, as controlling the character horizontally while standing on a ground tile/object is required.
Lesson learned, I’ll pay more attention to detail.
Hello there,
I wonder why we need to use two place_meeting for our collision detection. I tried using one and it worked fine
// === COLLISION DETECTION ===
if(place_meeting(x + horizontal_speed, y + vertical_speed, oCollision))
{
}
else
{
x += horizontal_speed;
y += vertical_speed;
}
// === END OF COLLISION DETECTION ===
Please note the if(place_meeting(x + horizontal_speed, y + vertical_speed, oCollision)) part
Are there gameplay differences between both techniques? Thanks for checking!