Most engines are designed in a "get-out-of-the-wall" kind of way (as opposed to a "stick-to-the-wall" kinda way) such that collision with the terrain are minimal and extremely brief. There's a high probability that the collision with terrain/wall parent event literally never happens. What you should do is put all this in the Step event inside an if statement which checks for collision with a slightly bigger mask than the collision detection uses (the easiest way to do this is using the function "collision_rectangle").