It fixes right movement, but if you start the map and press right, you can't go left at all, and if you start the map and go left, it causes the player to fly uncontrollably fast to the left and can't go right. It's been giving me weird variations of this glitch no matter how I rearrange the code.
BTW, what's the purpose of this line? Like I said I'm new to coding and some of this doesn't make sense yet, though I've learned a lot in the past two days alone.
Code: Select all
vx = Clamp(vx, -SideMove1, SideMove1);
Also I should have mentioned before, but I renamed Decelerate to Friction and created a new constant for decelerating.
EDIT: Solved the error. I'm not entirely sure what caused it, thought I deleted a line but it's still there. Oh well.