Player is shooting towards 0,0 instead of toward mouse

Here is my code, I can’t figure out how to get the bullets to shoot towards where the mouse is pointing.

using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour
public float moveSpeed;

public GameObject bullet;
public Camera camera;
public float bulletSpeed = 10.0f;
public float shootDelay = 0.2f;
private bool canShoot = true;

void FixedUpdate ()
	//player movement
	Vector3 moveDirection = new Vector3 (Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"),0);
	rigidbody.velocity = moveDirection * moveSpeed;

	if (Input.GetMouseButton(0) && canShoot) 
		Vector3 vecto = new Vector3(Input.mousePosition.x,Input.mousePosition.y,0);
		Ray ray = camera.ScreenPointToRay (vecto);
		Vector3 shootDirection = ray.direction - transform.position;
		GameObject bulletInstance = Instantiate(bullet,transform.position, bullet.transform.rotation) as GameObject;
		bulletInstance.rigidbody.AddForce (shootDirection*bulletSpeed,ForceMode.VelocityChange);
		canShoot = false;
		Invoke ("ShootDelay", shootDelay);



void ShootDelay()
	canShoot = true;


Playing around with your script, It seems to work fine for me if it is a 3rd person game, but if you are doing a 1st person shooter, you don’t need to subtract the position from the shoot direction:

Vector3 shootDirection = ray.direction;