Hello everyone, I am working on a 2D platformer game, and I am facing a challenge coding the player movement. The intended behaviour is for the player to be able to walk around any shape, circles, triangles, etc, sticking to it and snapping on vertices. Currently I am using a state machine in combination with a series of get_wall_normal(), get_floor_normal() and get_ceiling_normal() functions to rotate the player sprite depending on the surface. This works specially well on the floor where the player can snap to any surface using the editor settings. (Snap Lenght, and Max Angle). But these settings only exist for floors, and I am finding trouble defining the same behaviour to something that is not the floor.
Any suggestions or solutions out there?
How would you start off making something like that with raycasts.
Im really confused about the use of raycasts and other slightly more advanced functions and am quite new to game development in general.