Ok to change friction at run time?

I am using b2Fixture::SetFriction to change the friction depending on the current contacts.

This works fine, but is it an ok thing to do?
thx
Yes, this is supported.
Thank you Eric!

One more related question. Is it ok to have a friction value larger than 1.0?
Yes, you can have friction between 0 and max float.
I upgraded from 2.1.2 to 2.2.1.

Sometimes when I change the friction to 0 on the fixture and then back to some value the fixture acts as if it didn't have any friction. This happens only sometimes and other times it works. I log the value returned by b2Fixture::GetFriction and it has the correct value.

I change the friction in beginContact and endContact. I have also tried to move the friction change to before b2World step (by just setting a bool in beginContact/endContact) but that doesn't work either.


Any ideas? Thx

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