I need to make my gun understand that if I shoot the wall or ground a bullet mark will appear but if I shoot my enemy a blood splatter will show.
How can I make this happen?
I have the bullet mark working fine but it still shows on my enemy.
public GameObject BulletMark;
public GameObject Blood;
void Shoot(){
animation.Play();
audio.Play();
//Normal Raycast //Add a random value to mouse position(r
ray = Camera.main.ScreenPointToRay(Input.mousePosition+Random.insideUnitSphere*GunRecoil);
if(Physics.Raycast(ray, out hit, 10)){
//Declear new GameObject variable
GameObject BulletHole;
//Create the shootmark prefab at the hit point
BulletHole = Instantiate (BulletMark, hit.point+(hit.normal*0.001f), transform.rotation) as GameObject;
//Rotate the created object at the face of the normal LookAt (hit.point+hit.normal)
BulletHole.transform.LookAt(hit.point+hit.normal);
BulletHole.transform.parent=hit.transform;
hit.transform.gameObject.SendMessage("Hit", 5, SendMessageOptions.DontRequireReceiver);
}