im trying to follow the youtube tutorial, but i cannot make the turret to fire, the script is exactly the same, and i do have a spawn point, script is:

var LookAtTarget:Transform;
var damp = 6.0;
var bullitPrefab:Transform;
    




function Update () 
{
    if(LookAtTarget)
    {
        var rotate = Quaternion.LookRotation(LookAtTarget.position - transform.position);
    		
        transform.rotation = Quaternion.Slerp(transform.rotation, rotate, Time.deltaTime * damp);
    		
        Shoot();
    }
}
    
function Shoot()
{
    var bullit = Instantiate(bullitPrefab, transform.find("SpawnPoint").transform.position ,
    							Quaternion.identity);
    							
    bullit.rigidbody.AddForce(transform.forward * 1000);
    						

}

Change “find” to “Find” with a capital “F”
here is the line of code.

Also make sure your spelling of the “spawnPoint” is correct. Check the turret for spawnPoint object name.

var bullit= Instantiate(bullitPrefab,transform.Find("spawnPoint").transform.position,Quaternion.identity);	//create bullet

Also after doing this code and adding it to your turret, click the turret object in your heirarchy and drag your worm object into the LookAtTarget Prefab box on the inspector window and the fireball prefab into the bullitprefab box of your inspector window.
Also one more thing is that do not add your worm prefab as your lookattarget, add the worm object from your scene heirarchy. But I can see that u are not having problems with the looking part.
also you can make thw turret actually move closer to your character uptil a certain distance.

Here is the code.

var ahead=transform.TransformDirection(Vector3(0,0,1));			//Go  ahead  direction 
		var distance=Vector3.Distance(LookAtTarget.position,transform.position); //calculate distance between turret and player
		if(distance>enemyStopDist)										//keep distance from player
		{
			turretController.SimpleMove(ahead*turretMovSpeed);
		}
//Here, enemyStopDist is a var that is  the  distance at which the turret will stop moving closer to your worm

Hope this helps.

A better way is to not use Find.
Just as you have var bullitPrefab:Transform and dragged your fireball into it you can use
var spawnPointPrefab:Transform. After doing this follow these steps.
Make your spawnpoint object into a transform by dragging it from the Heirarchy to project window.
Drag your spawnPoint object(not prefab, but the one in your heirarchy window) from the turret object (not prefab) into the turret>inspector>turretControl>spawnPointPrefab box.

This way the unity run time environment does not have to search for every object to find your spawnPoint.