//BugFix
public bool CanSlide = false;
public PhysicsMaterial2D NoSlide;
public PhysicsMaterial2D Slide;
void Start()
{
rb = GetComponent<Rigidbody2D>();
}
void FixedUpdate()
{
BugFix();
}
void BugFix()
{
if (movement.x == 0 && !CanSlide)
{
rb.sharedMaterial = NoSlide;
}
else
{
rb.sharedMaterial = Slide;
}