title: Unity3d: Backspin of Sphere with Rigidbody
body: <p>I am by any means not a physics expert, hence I can't really tell how the effect I am looking for is called. I'll just call it "Backspin" for now :)</p>
  
  <p>Picture this scenario:</p>
  
  <p>There is a ping pong ball in front of you on a ping pong table. You put pressure with your finger on it (going from the top of the ball to the bottom with a lot of force). The ping pong ball will slip off your finger moving forward but with a backwards spin. So, eventhough it moves forward it will eventually roll back to you due to its backwards spin :D</p>
  
  <p>I hope that makes sense. I don't really know how this effect is called so I can't really look up solutions.</p>
  
  <p>I do have a simple plane with a sphere (rigidbody attached) on it. I want to simulate this exact effect by swiping over the screen. But most importantly, how can that effect be achieved? The effect should also be effected by exactly where pressure is put on the ball (left or right). I just want it to move forwards while spinning backwards and eventually rolling back due to its backforce (not to exactly the same spot but more realistic).</p>
  
  <p>I've experimented with Addforce and Addtorque but no success.</p>
  
  <p>Any help is highly appreciated.</p>
  
  <p>Have a nice day!</p>
  
  <p>EDIT: What I have so far:</p>
  
  <pre><code>public float spin = 1000f;
  public float force = 20f;
  public float angularVelocity = 100f;
  private Rigidbody rb;
  private Vector3 oldPos;
  private Quaternion oldRot;
  public int pressed = 0;
  
  void Start () {
      oldPos = transform.position;
      oldRot = transform.rotation;
      rb = GetComponent&lt;Rigidbody&gt; ();
      rb.maxAngularVelocity = angularVelocity;
  }
  
  void FixedUpdate ()
  {
      Debug.Log(rb.velocity.magnitude);
  
      if (Input.GetKey(KeyCode.Space))
      {
          Debug.Log("pressed");
          pressed = 1;
          rb.AddForce(new Vector3(0,0,force),ForceMode.VelocityChange);
          rb.AddTorque (new Vector3 (-spin, 0, 0), ForceMode.Force);
      }
  }
  </code></pre>
  
  <p>Edit2: </p>
  
  <pre><code>public float spin = 1000f;
  public float force = 20f;
  public float angularVelocity = 100f;
  private Rigidbody rb;
  private Vector3 oldPos;
  private Quaternion oldRot;
  public int pressed = 0;
  public float forceTime = 1f;
  public float startBack = 0.25f;
  
  void Start () {
      oldPos = transform.position;
      oldRot = transform.rotation;
      rb = GetComponent&lt;Rigidbody&gt; ();
      rb.maxAngularVelocity = angularVelocity;
  }
  
  void FixedUpdate ()
  {
      Debug.Log(rb.velocity.magnitude);
      if (pressed == 2)
      {
          rb.AddForce(new Vector3(0,0,-force),ForceMode.Acceleration);
  
      }
      else if (pressed == 1 &amp;&amp; rb.velocity.magnitude &lt;= startBack &amp;&amp; rb.velocity.magnitude &gt;= 0f)
      {
          pressed = 2;
          StartCoroutine("StopForce");
      }
      else if (Input.GetKeyDown(KeyCode.Space) &amp;&amp; pressed == 0)
      {
          Debug.Log("pressed");
          rb.AddForce(new Vector3(0,0,force),ForceMode.VelocityChange);
          rb.AddTorque (new Vector3 (-spin, 0, 0), ForceMode.Force);
          pressed = 1;
      }
  }
  IEnumerator StopForce () {
      yield return new WaitForSeconds(forceTime);
      pressed = 3;
  }
  </code></pre>