Rigidbody2D AddForce doesn't work

I have a sprite ball with Rigidbody 2D, Circle Collider 2D and with this script:

public float thrust;
public Rigidbody2D ball;

// Use this for initialization
void Start () {
	ball = GetComponent<Rigidbody2D>();
	ball.AddForce(new Vector2(0,1), ForceMode2D.Impulse);
}

But my ball is not moving, why? (Yes my rigidbody is assigned to public variable Rigidbody 2D)

First of all if you have assigned the ball variable already in inspector then you can remove the first line of the Start method as that will reassign the ball variable with the objects own Rigidbody2D component.

Script seems to be just fine and I doubt that that is the problem. My guess would be that you have something wrong with your Rigidbody2D component settings.

  • First of all Body Type has to be Dynamic
  • Simulated has to be true
  • If you have high Mass you need to add more force than 1 unit
  • If you have high Linear Drag then the object might pretty much stop immediately
  • If you have gravity and try to move against that you might also need more than 1 unit of force
  • Constraints for the axis you want your object to move has to be false

Hi @tomsk , maybe you need to put your “AddForce” line of code into void Update() function not in void Start(). Correct me if I’m wrong, void Start() is triggered once the game start/script start, then the AddForce script won’t work there.