Gravity not working properly? [GML]
With gravity in real life (assuming air resistance is negligible), if an object leaves a platform with a certain velocity it will come back down to the platform with the same velocity, assuming constant acceleration (gravity). However, in game maker if I use motion_add to give my character an instantaneous upwards velocity of N p/step, it comes down with roughly half that velocity. I have tried using both gravity=N and motion_add(270, N) while grounded==0.
Can anyone explain what is going on and how to fix it? thanks
Posted Dec 14, 2013, 4:12 AM UTC
11
Are you using built in friction? I've had problems with the friction variable, because it applies equally horizontally and vertically. I usually roll my own friction function, with surface friction, air resistance, etc. Try taking friction out of your movement code and see if it makes any difference.
Also, try setting vspeed directly-