I have these two functions for removing and reinstating friction for a physics object, here they are
function removeFriction () {
var frictionlessMaterial = new PhysicMaterial();
frictionlessMaterial.dynamicFriction = 0;
collider.material = frictionlessMaterial;
}
function reinstateFriction () {
var standardMaterial = new PhysicMaterial();
standardMaterial.dynamicFriction = 1;
collider.material = standardMaterial;
}
the problem is, nither of them work. When I told it to print out the dynamic friction it's 0.4, so clearly niether of them have worked even once. I've tried modifying a single material as well, but that doesn't seem to work either. What am I doing wrong?