- Home /
AddTorque in 2D doesn't work?
Here's what I have done:
if (!isDead) {
float move = Input.GetAxis ("Horizontal");
gameObject.GetComponent<Rigidbody2D> ().velocity = new Vector2 (move * speed, GetComponent<Rigidbody2D> ().velocity.y);
gameObject.GetComponent<Rigidbody2D> ().AddTorque (10.0f*move);
}
But my 2D object does not spin as it should. What am I doing wrong?
Comment