looking for a good fix against slope sliding

Hello,

According to a member here i got s script with anti slope sliding build in, it’s pretty forwards, just a tiny z upwards velocity. this works great at physics substeps 1 but at higher level 3-5 it will start to bounce. I found out that it is due to the upwards motion.


if slope_sliding == False:
                # turn slope sliding off            
                z = 0.16334   # 0.16334 counters the sliding when on a slope

This stopped the char from sliding down even at 80+ degree angles.

i know i can fix this by just using a plane(for the slope) with a property and look for that to set the upwards motion to counter it, but i was wondering if there are easier solutions, or is there a way to detect if you are on a slope (if you have all data of the object)?

Turn friction way up.

Turn friction off and use a servo motion
Idle stops the actor

If forward.positive:
    if own.localLinearVelocity.x <5:
        own.applyForce((100,0,0),1)
   # if slide = 0 no sliding 
   # if slide = 1 no sideways friction 
    Slide =. 5
    own.localLinearVelocity.y*=Slide
    # stops sideways motion when turning 
    
If idle and on ground:
    own.localLinearVelocity.x *=. 2
    own.localLinearVelocity.y*=. 2

Turn friction way up.

player is 0, zetting object to 100 friction does nothing.

Turn friction off up and use a servo motion

if i turn friction up on the player then when you jump against something it wil stick, so i don’t want that too happen.
i can use that but that is basicaly rewriting the script, i dont see the need for that, becayse at normal settings the setup works fine.