Then I will show you an example of how to make the character walk more real and not straight, I do not know if you will ultil of something, but normally in real life we walk down the look a little downward and then up, you lack improvements to this project
Here you can view the code:
www.gamemaker3d.com/player?pid=053346829623