When I shoot its should create a bullet and a flash (I have a model for the flash)
however it gives this error:
No appropriate version of 'UnityEngine.Object.Instantiate' for the argument list '(UnityEngine.Transform, UnityEngine.Vector3)' was found.
Here is my script:
var theBullet : Rigidbody;
var Speed = 20;
var theFlash : Transform;
function Update ()
{
if (Input.GetMouseButtonDown(0))
{
var clone2 = Instantiate(theFlash, transform.position);
var clone = Instantiate(theBullet, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection(Vector3(0, 0, Speed));
Destroy (clone.gameObject, 3);
Destroy (clone2.gameObject, 0.5);
}
}