How to create slippery surfaces?

Quick question,

I’d like the player to slide after releasing the walking keys, rather than stopping abruptly.
I know Servo Motion makes objects slide by default, but I want to stick with Character physics (as they’re not compatible together)

Is it possible via python?

Thanks!

Yes, it’s possible. I use a complex property-based method for slidey vehicles.
Using three properties - “speed”, “maxSpeed”, and “acceleration” - I apply the “speed” value to the speed that the player is moving, and the speed goes up and up by the “acceleration” value until it hits the “maxSpeed” value, as long as the key is held down. If no keys are being pressed, it’s the opposite. Speed goes down by “acceleration” until it’s equal to 0.

Does sound rather complex.
I’ll take a crack at it though, can’t find anything to do with creating icy floors using Google, so have nowhere else to turn.
Hope this works!

Does the material friction setting not affect the character physics type?

Does sound rather complex.
I’ll take a crack at it though, can’t find anything to do with creating icy floors using Google, so have nowhere else to turn.
Hope this works!

Ill agree with you on this. I know you dont like dynamic physics type, but it might be the easiest way to go. You could just set more friction on some objects materials and less on others. Easy and dont. because I also dont know if…

Does the material friction setting not affect the character physics type?

this works.

Also:
Switching to dynamic might also fix your jumping/falling speed problem as well. As gravity would affect your object realistically, accelrating as it falls. You could fall slower by applying a counter force upwards.

Just tried using the friction with Character Physics, doesn’t work… well, I don’t think it does.
Not entirely sure how to set friction up to enable sliding, but the sliding Servo Motion provides is quite nice.

I know you dont like dynamic physics type, but it might be the easiest way to go.

Tempting, but if I make the switch I’ll lose the glorious (and perfect) jumping system I have set up.
I don’t even know how to set up jumps without the character actuator button.

im not sure if work with character physic
this anyway the max-speed is given by the HP of car and the air friction(not linear) 8)


import bge




own = bge.logic.getCurrentController().owner
kev = bge.logic.keyboard.events
w, s = [kev[ord(k)] in [1,2] for k in "ws"]
k_gas = w
k_brakes = s 




# air friction
sp = own.worldLinearVelocity.magnitude
if sp > 10: #below that we say .. no friction
    own.worldLinearVelocity.magnitude = sp ** 0.98






hp = 500.0
brakes = 0.98


if k_brakes:
    own.worldLinearVelocity.y *= brakes

elif k_gas:
    own.applyForce((0, hp*own.mass, 0) ,1)





Car, you say?
Would the script also work on people?

Not sure if there’s been a misunderstanding, but the sliding is for a platformer. (Ice-themed)
Don’t believe I mentioned it in the main post… my bad.