Sonic style wall running

Godot Version

4.2

Question

How would i implement running on walls like the sonic series? i need the ground to act as walls normally, but when running up a slope the player will run on the wall like the floor.

image

try set floor_snap_length to 0.0

also try set floor_max_angle to 90.0+

okay, but how exactly will that help run on walls? the player will still be moving in the x axis and cant run on ceilings.

Honestly I never tried to tackle a problem like this before… But what I would try is…

-Put a series of colliders along the curvature of the round part and on the wall
-Put scripts or group each collider to how the kinematic body should behave at that point
-put a raycast aiming at the ground to receive data from colliders
-Have your scrip detect the velocity of your character and rotate the kinematic body accordingly and turn off gravity as well as long as the player has the proper velocity.

I’m sure there is a more wizardly way to code this, but I’m not a wizard, just a sage. And my only saving grace is my ability so BS my way through tough coding challenges using raycast and colliders to fake everything…

If this is tile based, could you have some contract that sees if the tile is a slope and transitions the velocity to the appropriate angle? I am new so sorry if this isn’t helpful :slight_smile: Just trying to engage and learn more.