Problem with friction and my player

Hello,

I’m new in Unity. I’m making a 2D game to learn.
I have a 2D player who have rigidbody2D and a circle collider2D.
I place tiles in the scene with collider2D.

On player and tiles, I put a PhysicsMaterial2D with friction set to 0.
My tiles are leaned, so the player should slide on it.

But my player is translate on x and y slowly.

void FixedUpdate(){
  float h = Input.GetAxis ("Horizontal");
  movement = new Vector2 (speed.x * h, rigidbody2D.velocity.y );
  rigidbody2D.velocity = movement;
}

Anyone have an explication ?

Thanks.

You’re directly setting the velocity, so only the velocity you set applies. You could try AddForce instead.

It’s work :slight_smile: