GML Dashing trough stuff is annoying


Hey, i've got a very simple dash state that works just like my move state, but with a higher speed. The problem with a higher speed is that it teleports trough solid objects. I can use "if(!collision_line(bla,bla,bla)) {x+whatever, y+whatever}" to not teleport over objects, but i don't want to stop completely, i want to get as close to the object as possible, so i thought about using a for loop "for(var i=0, i<length, i++)" and checking one pixel closer to the player every i, yet i could'nt get this to work because it happens on different frames. Any ideas?