if(Input.GetKey(KeyCode.W)){
collider.material.staticFriction=0;
collider.material.dynamicFriction=0;
}
else
{
//collider.material.staticFriction=100;
collider.material.dynamicFriction=100;
}
In this code I want the player body to stick to the ground with heavy friction when the W button is not pressed. and to glide when the W key is pressed. The problem is it wont update at every frame instead it only responds if the collider encounters a new collider like if the player hits a wall or jumps and comes back down on the ground. How can I get it to change the friction as soon as I press or release the move button.
Thanks,
Austin