Cataclysmanic / GO2022

4 stars 1 forks source link

for players, walls feel sticky, reapply the remaining move vector after the collision #26

Closed plexsoup closed 2 years ago

plexsoup commented 2 years ago

It's hard to navigate buildings because the Detective2D, using move_and_collide(), gets stuck on walls. We need to reapply the sliding vector after the collision.

See instructions here: https://docs.godotengine.org/en/2.1/learning/features/physics/kinematic_character_2d.html?highlight=slide#solution

plexsoup commented 2 years ago

Switched from move_and_collide() to move_and_slide(). Works better now. move_and_slide doesn't require delta, so I fudge delta to 1.0 for the old code.