Friction question

I've got objects for which I want there to be friction when I'm on top of them, but for when I'm colliding with their sides I don't want that force to be applied. The problem I'm running in to is that if I set an object to have some friction value and I set my player to also have a friction value, then while things work as I would like when he's standing on top of the object, if he's jumping while making contact with the side he will usually stop moving altogether (I'm guessing due to the Coloumb friction stuff). Here's an image of the problematic scene:

Image

The white thing is the player, the blue square is the object I'm talking about. I'd like to only have friction applied when I'm on top of that blue thing. As it stands, my vertical velocity gets mitigated by the frictional force of the object when I'm colliding with its sides. If I set the player's friction to 0 this obviously isn't a problem...but then again I'm not having friction applied at all so that doesn't do me any good.

Do I just have this set up in a less than optimal way? Is there a better way to accomplish this kind of thing? Thanks.
Sounds like a bit of a problem, as box2d doesn't allow you to apply friction to specific edges of a shape.

You could either set the friction of the box to 0, and 'fake' the horizontal friction on the player somehow.

Or you could split the box into three shapes, one triangle with friction for the upper surface, and two triangles for the sides, with friction set to 0.
Split your player (or your other objects) into pieces. Lower shape would have some friction, while other parts wouldn't.
Neosano wrote:
Split your player (or your other objects) into pieces. Lower shape would have some friction, while other parts wouldn't.

Oh, yes, that's probably the better choice. Make the 'feet' shape of the player a bit less wide, so it won't touch the sides of the boxes.
That sounds like a pretty good idea, thanks, I'll give this a shot later today.

Original thread: https://box2d.org/forum/viewtopic.php?t=3070