Since you're using a KinematicBody, it has the method getcollisionnormal()
, which looks like this:
https://www.geogebra.org/m/gqmbHdx6
After that, a dot product of the normal on the velocity will tell you if it's perpendicular (vertical wall, dot product being zero) or something else.
To know where to orient your body to climb up the ramp, doing the dot product of the up vector (Vector3(0,1,0)
) on the normal, then multiply the result to a normalized vector of the normal, then substract it from the up vector to get the final vector that slides along the ramp towards the top:
https://www.geogebra.org/m/rV4kSCre