title: Unity bullet spawn
body: <p><a href="http://i.stack.imgur.com/T9hYQ.jpg" rel="nofollow">Where the bullet spawns when I shoot</a></p>
  
  <p>Hi, for some reasons my bullet won't spawn where I tell it to.
  The spawn point is at the end of my barrel, I take its transform position and rotation when I instantiate the bullet, but it spawns higher than the gun (way higher).
  Here's the code that I have:</p>
  
  <pre><code>    Animation anim;   // Gun animation when shooting
  AudioSource gunSound; // Gun sound when firing
  public Rigidbody bullet; // I get the rigidbody of the bullet that will be spawned
  public Transform spawnPoint; // The position of where it is supposed to spawn
  
  
  void Start()
  {
      anim = GetComponent&lt;Animation&gt;();
      gunSound = GetComponent&lt;AudioSource&gt;();
  }
  
  void Update()
  {
      if (Input.GetButtonDown("Fire1"))  // If the left mouse button is clicked
      {
          Rigidbody bulletInstance;
          bulletInstance = Instantiate(bullet, spawnPoint.position, spawnPoint.rotation) as Rigidbody; // This is where I don't understand why?!?!
          bulletInstance.AddForce(spawnPoint.forward * 1000f);
  
          gunSound.Play();
          //anim.Play("GunShot4");
      }
  }
  </code></pre>
  
  <p>Help :)</p>