Fire weapon from turret to mouse position (3D Isometric shooter)

Hey So I have a script set up for a “Missile Command” type arcade shooter. The perspective is a 3d isometric view so I want the turret to be the origin for the raycast and fire off onto the enemies that appear. I can’t get any ray or instantiate to correctly work. Here is my script:`

using UnityEngine;

using System.Collections;

public class Turret2 : MonoBehaviour
{

public Transform cannon;
public Transform bullet;
private GameObject spawnPt;

// Use this for initialization
void Start ()
{
	
	spawnPt = GameObject.Find ("oneSpawn");
	
	Vector3 myTransform = cannon.transform.forward;
}

// Update is called once per frame
void Update ()
{
	
	if (Input.GetKey (KeyCode.Mouse0)) { 
	
		Vector3 myTransform = cannon.transform.forward;
		
		Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
	
		RaycastHit Hit;
	
		if (Physics.Raycast (ray, out Hit, 1000)) {
 
			if (Hit.collider.gameObject.CompareTag ("Sky")) {
			
				Debug.DrawRay (transform.position, myTransform, Color.red);
				
				GameObject newProjectile = Instantiate (bullet, spawnPt.transform.position, Quaternion.identity) as GameObject; 
			   
				newProjectile.transform.LookAt (Hit.point); 
			    
				newProjectile.rigidbody.velocity = newProjectile.transform.forward * 10;
				
			}
		}

	}
}

}`

I made a few changes to your script and posted it below. I think most of your problems were in the last line…the way you were shooting the projectile:

using UnityEngine;
using System.Collections;

public class Turret2 : MonoBehaviour {

public Transform cannon;
public GameObject bullet;
private GameObject spawnPt;
 
void Start () {
    spawnPt = GameObject.Find ("oneSpawn");
    Vector3 myTransform = cannon.transform.forward;
}
 
void Update ()
{
    if (Input.GetMouseButtonDown (0)) { 
       Vector3 myTransform = cannon.transform.forward;
			
       Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
       RaycastHit Hit;
       if (Physics.Raycast (ray, out Hit, 1000)) {
         if (Hit.collider.name  == "Plane") {
          Debug.DrawRay (transform.position, myTransform, Color.red);
          GameObject newProjectile = Instantiate (bullet, spawnPt.transform.position, Quaternion.identity) as GameObject; 
          newProjectile.transform.LookAt (Hit.point); 
          newProjectile.rigidbody.AddRelativeForce(Vector3.forward * 2000);
         }
       }
    }
}
}