title: Throw a game object via C# Unity
body: <p>Having a little trouble of getting a game object thrown. I had a 2d game where by the game object i want thrown is a grenade. At the moment, I have the following code:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  [RequireComponent(typeof(Rigidbody))]
  [RequireComponent(typeof(CapsuleCollider))]
  
  public class SoldierController : MonoBehaviour
  {
  
      public GameObject grenadeObject;
  
       void Start()
          {
              grenadeObject.SetActive(false); 
          }
  
      void Update()
      {
       if (Input.GetKeyDown(KeyCode.I))
                      {
                          grenadeObject.SetActive(true);
                          animator.SetBool("Grenade", true);
                          GrenadeThrow();
                          //speed = Mathf.Lerp(10, 0, Time.deltaTime);
                         // grenadeObject.transform.Translate(Vector3.forward * 10);
                          StartCoroutine(GrenadeCooldown());
                      }
  
       }
  
      void GrenadeThrow()
          {
              StartCoroutine(COPlayOneShot("Grenade"));
              Instantiate(grenadeObject, new Vector3(10 * 2.0F, 0, 0), Quaternion.identity);
          }
  
  
          IEnumerator GrenadeCooldown()
          {
              canFire = false;
              yield return new WaitForSeconds(0.01f);
              //rifleMuzzle.GetComponent&lt;ParticleSystem&gt;().top();
              canFire = true;
              animator.SetBool("Grenade",false);
          }
  }
  </code></pre>
  
  <p>I would expect the object to at least be thrown out of the character hand except nothing happens at all. Any help/?</p>