title: Unity 3D Cube-Rotation
body: <p>i have simple unity project where i created simple cube. When i press spacebar this cube jumps. </p>
  
  <p>My Problem is - i want to implement also 360 Rotation around Y-axis (only once and then stops) when i press spacebar.  How can i do this?</p>
  
  <p>Heres my current code:</p>
  
  <pre><code>void Start () {
  
          mSpeed = 3f;
          RB = GetComponent&lt;Rigidbody&gt;();
  
      }
  
      // Update is called once per frame
      void Update () {
          transform.Translate(mSpeed*Input.GetAxis("Horizontal")*Time.deltaTime,0f,mSpeed*Input.GetAxis("Vertical")*Time.deltaTime);
          //transform.Rotate(Vector3.up, 100 * Time.deltaTime);
  
          if (Input.GetButtonDown ("Jump")) 
          {
              RB.velocity = new Vector3 (0,5,0);
          }
  
      }
  </code></pre>