# Add speed to a 2d object regardless of direction.

I am trying to create a ball that gains speed whenever it bounces off a an object. I tried using rigidbody2D.AddForce and rigidbody2D.velocity but these are directional and i would have to know the direction the ball is facing in order to add a speed in the right direction. I came into a problem where if the ball was moving a left and it hit a collider and I added a force to its x direction that was positive it would slow down or at times equal out to 0 and the ball would just go straight up or down. Knowing which direction the ball is facing to add force or velocity in the right negative or positive value is possible but seems like a unnecessary work around to a simple solution I just cant figure out and dose not seem like a optimal solution.

Why is it such as hassle obtaining the direction of the ball. rigidbody2D.velocity contains the direction of your ball, within its x, y, z components? If you only are interested in manipulating the speed by some factor, you could do something like this:

``````rigidbody2D.velocity *= someFactor;
``````

This will increase the speed of the ball, in its current direction.