Godot Version
v4.3.stable.official [77dcf97d8]
Question
I’m working on a 2D game and am thinking about adding friction based physics to it. I’d also like to have areas with different physics, such as a ‘normal’ area and an area with ‘ice’. I’d like this to work with both RigidBody2D and the CharacterBody2D I’m using for the player and enemies.
Unfortunately, the Godot documentation is not very clear about how friction is used. The PhysicsMaterial just has a single float value for ‘friction’ that takes values from 0 to 1. The docs just say that higher values have more friction. A lot of posts I’ve looked at say you need to have values much higher than 1 to get a decent frictional response.
How exactly is this friction value used? Is this the same as the coefficient of friction? To adjust the velocity of my characters in a manner similar to the physics engine, how should I use this value to modify the velocity of my character?