title: How to create a projectile Script in Unity
body: <p>so recently my friends and I are trying to make a game for fun.  Currently, I hit a wall and not sure how to do this.  I am trying to create a simple base script where I have the character move and attack with right click.  If it hits the ground, it will move there and and if in range of a target, it will send a projectile.  So the game is creating the projectile but its not actually moving.  Can anyone tell me what I should probably do.  At first, I thought to just make it all one script but now I am thinking it be best to make another script for the projectile.</p>
  
  <pre><code>void Update()
  {
      if (Input.GetMouseButtonDown(1))
      {
          RaycastHit hit;
  
          if(Physics.Raycast (Camera.main.ScreenPointToRay(Input.mousePosition), out hit) &amp;&amp; hit.transform.tag == "Minion")
          {
              if(Vector3.Distance(this.transform.position, hit.point) &lt;= atkRange)
              {
                  GameObject proj = Instantiate(bullet) as GameObject;
                  proj.transform.position = Vector3.MoveTowards(this.transform.position, target, atkSpd);                                  
              }                             
          }
          else if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, speed))
          {
              agent.destination = hit.point;
          }
      }
  }
  </code></pre>
  
  <p>So this is what I originally had.  I am pretty sure I did something wrong here.  Also I am not sure if I should have another script for the projectile itself or if it is not necessary.  Thank you for any help or tips on what to do.</p>