ABC124816 ABC124816 loading
Guys, I drastically modified my code, keeping the old script on the right. And it works on constant gravity, and switching gravity works… sometimes and only when you go slowly. In fact, it looks more buggy than my previous code. Can someone tell why my code isn't working? The detection is not by hitbox now, but through the following logical deductions:

Moving out of a hit bottom or top platform takes less than the absolute size of the v2 value, if it takes more than that to move out, then it must be a wall. Then, if v1 is positive (meaning the player moved to the right.) then it was a right wall. Else, it was a left wall.

Is my code not implementing this logic correctly, or is there something wrong with the logic itself? Or it is hitting the walls in too many directions? Or something else?