I have a raycast gun script and for the particle spark effect i have use Var Effect : Transform; and when i got to drag my sparks into the effect box the sparks wont work when i shoot my gun.
var endBarrel :Transform;
var sound : AudioClip;
var TheDamage = 100;
var Effect : Transform;
var Enemy : GameObject[];
function Start()
{
}
function Update()
{
var hit : RaycastHit;
if(Input.GetButtonDown("Fire1"))
{
// you can use PlayOneShot to specify the sound...
audio.PlayOneShot(sound);
audio.Play();
}
if (Input.GetMouseButtonDown(0))
{
if (Physics.Raycast (endBarrel.position, transform.forward, hit, 500))
{
Debug.DrawRay(endBarrel.position, endBarrel.forward * 100);
hit.transform.SendMessage("ApplyDamage", TheDamage, SendMessageOptions.DontRequireReceiver);
}
}
}