Negative Vector2D inputs do not work

I am trying to make an object move with doubel the speed to the Opposite direction off the gravity and it shows the right numbers in the Debug.Log but somehow the object does not move the oppositte way :frowning:
(and yes i applied the code to the object)

the code :

var Negative = (Physics2D.gravity) *2 / 100;

Negative.x *= -1;
Negative.y *= -1;

_rigidbody.AddForce(Negative, ForceMode2D.Force);

Debug.Log(Negative);

please use code tags.

Why are you dividing by 100? Remove the division. Also, you’re taking an acceleration value (gravity) and are applying it as a force, so now it’s mass-dependent. Multiply “negative” by _rigidbody.mass.

finally, instead of doing

Negative.x *= -1;
Negative.y *= -1

you can negate the vector as a whole. The corrected code:

var Negative = -1f * Physics2D.gravity * 2f;

_rigidbody.AddForce(Negative * _rigidbody.mass, ForceMode2D.Force);

Debug.Log(Negative);

oh and don’t forget to set gravity scale to 0 on the rigidbody2d