How to make Physics2D.gravity only affect an individual Rigidbody2D

I was trying to make a dash code for my player but for some reason when I dash all the other Rigidbodies seem to float up. Is there a way to let the Physics2D.gravity to only affect my player?

void Update()
{
if(Input.GetMouseButtonDown(0) && canDash == true)
{
if(Input.GetAxis(“Horizontal”) < 0)
{
rb2d.velocity = Vector2.left * 15;
Physics2D.gravity = new Vector2(0f,5f);
Invoke(“stopDashing”, 0.1f);
canDash = false;
}
else if(Input.GetAxis(“Horizontal”) > 0)
{
rb2d.velocity = Vector2.right * 15;
Physics2D.gravity = new Vector2(0f,5f);
Invoke(“stopDashing”, 0.1f);
canDash = false;
}
}
}

void Update()
{
if(Input.GetMouseButtonDown(0) && canDash == true)
{
if(Input.GetAxis(“Horizontal”) < 0)
{
rb2d.velocity = Vector2.left * 15;
Physics2D.gravity = new Vector2(0f,5f);
Invoke(“stopDashing”, 0.1f);
canDash = false;
}
else if(Input.GetAxis(“Horizontal”) > 0)
{
rb2d.velocity = Vector2.right * 15;
Physics2D.gravity = new Vector2(0f,5f);
Invoke(“stopDashing”, 0.1f);
canDash = false;
}
}
}

Sorry! Seems like my code was posted wrongly

try creating its own gravity with rigidbody.addforce and change the value to change its gravity.