Hi, I am doing an endless runner, firstly the friction of my physic material for the ground is 0, but when the player hit an obstacle i want to change the friction to 1, so the player stop moving. How can i do that? In c#
Good day.
If you want the player to stop, maybe you should just change its velocity and mantain the friction.
But if you need to change the friction, you should take al look at Physic Materials.
There are 2 frictions, dynamic and static. dynamic friction is applied when object have no movement, for calculate the force needed to start moving an object. Once is moving, the dynamic friction is applied.
For my experience, i recommend you to modify speed instead of friction.
If helped, please accept the answer! :D