change friction

How change friction -as in Material/Dyn- ( something like 2 when a sensor key is not positive and 0 when positive) with Python script?

I don’t see any method of doing that via Python in the Python references. I don’t think it’s possible at the moment.

Well this is kind of weird way of doing things, but you could always have 2 identical meshes with the same color/uv settings, and then have them different materials. Then just switch them out using add object/end object. I don’t know if replace mesh would work, but it might.

Ok :frowning:
I will try add/end object… Thanks for answer!

Hey, that’s clever! I hadn’t thought of that. I think that replace mesh should work just as well as add/remove object, since the material is a feature of the mesh, not the object.

Would it be possible to have two materials on one object and then use Python to switch which material is in use? I know you do stuff with materials when you are using GLSL. I wonder if there is a setMaterial()? Time to go check out some references.

This is about all I could find:

To explain a bit more:
I use the FPS template of Social.
To climb a ladder or against a wall, with a simple texture and a link to Floormove actuator I do not need code; but the player goes down if it stops advancing. It is not serious for a ladder but i my game it is an old sailing boat: If the player wants to go up on the masts, it must be able to stop during the rise (or while going downwards).
I know that by a friction > 1.5 in my climb texture the player can stop in the rise but this time the slope must be low (<20°)… from where my idea to change the friction if the player projection stops.
In all case I need to intercept ‘on climb texture AND move keys’ …

For a ladder, I wouldn’t use friction. There are much better ways to do it. Here’s a basic example… it would need a little tweaking, but the basic idea is there.


ladder.blend (194 KB)

LOL … why do I never think so simply! Thank you TheSambassador!

Edit: …hem, to climb forward, ok but backward (down) its a fall.