I'm trying to make a shooting script but I got this error again. This time apparently on the line 9. Error is: BCE0044: expecting '"', found 'r'
public var bulletPrefab:Transform;
public var bulletSpeed : float = 6000;
function Update() {
if(Input.GetMouseButtonDown(0)){
if(!bulletPrefab || !bulletSpeed){
Debug.Log("[Shoot] 'bulletPrefab' or 'bulletSpeed' is undefined' ");
}else{
var bulletCreate = Instantiate(bulletPrefab, GameObject.Find("SpawnPoint').transform.position, Quaternion.identity);
bulletCreate.rigidbody.AddForce(transform.forward * bulletSpeed);
}
}
}
↧