I am making a car with a minigun turret on top, but i cant get my shoot script to work.
I wrote my own script but when that failed i copied and modified the one from the script-reference.
the code is:
var Bullet : Transform;
function Update () {
if (Input.GetButtonDown("Fire1")) {
var clone : Rigidbody;
clone = Instantiate(Bullet, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection (Vector3.forward * 10000);
}
}
but i keep getting a error saying: Cant cast from source type to destination type
checked everywhere but other that restarting unity i cant find any other suggested solutions and i have already restarted 100 times or so… plz help ![]()