Riiiight I forgot about that. At the very least you got something made though. But what does it mean the swords depend on the player's velocity? I just touch spike and get sword. I just move and kill the enemies.
If it's because you use rigidbody.AddForce() for your horizontal movement, I think you can try something like:
rigidbody.velocity = new Vector2(Mathf.SmoothDamp(rigidbody.velocity.x, Input.GetAxisRaw("Horizontal"), ref walkVelocity, smoothTime), rigidbody.velocity.y);
where smoothTime is the time you want the movement to change and walkVelocity a variable that the function uses to store the acceleration.