- Home /
negative x value in Vector2
So I've been trying my hand at some game dev, and I've been trying to implement a simple pong game, but it seems setting the balls starting velocity to a negative value on the X plane still makes it into a positive force.
I ran into this first with rigidbody2D.AddForce(v2)
where v2 is a Vector2 with a -x value, and with setting setting the rigidbody2D.velocity
directly, but the force is always positive.
On the flip side of the issue, a negative y works perfectly fine, any ideas as to whats going on?
rigidbody2D = GetComponent<Rigidbody2D>();
Vector2 v2 = new Vector2(-10, 0);
rigidbody2D.AddForce(v2);
that's the misbehaving code, any reason why positive force is being applied in the x axis?
Your answer
Follow this Question
Related Questions
Diagonal speed too fast with 0.7 multiplier 2 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How can I add force in the opposite direction of the mouse? C# 0 Answers