so. what did i learn from other 2D platformer games that makes walking such a complicated thing to implement? well, the two gifs i recorded today illustrates part of the problem.

the cyan line represents the normal of the surface the player is currently considered standing on. when the player is in the air, the normal becomes straight up. since i'm just walking on this slope, we shouldn't see the cyan line point straight up, but it does as i walk up and down. as i stop walking up the slope, my vertical velocity pops me into the air, and as i walk down, i hop off of the ground because i move directly left, and not down the slope.

i've started working on the fix, as shown in the second gif. the red line now shows the actual direction i'm walking in. as i walk up the slope now, i pop up over and over again, but the descent is nice and smooth.

so the next goal is to basically "magnet" my feet to the floor while i'm just walking across the ground. this is easier said than done, but i did a little more work after this gif and am getting close. access to the normal of the floor will also let me cleverly solve the issue of walking (or not being able to walk) up slopes...

daily creative

work on something (gamedev, art, 3d modeling, music, ...) every day

joined 1,787 days ago

2024-11
2024-10
2024-09
2024-08
2024-07

Decade Jam

To help keep members of the Decade Jam on track with their projects!

joined 1,310 days ago