Instantiate diffent particle for different object

Hello there ,
I want my bullet to have different particles when it hits different tagged object.
Here is my script , but it’s not working , and I don’t know why!

//Particles
var HitConcrete : GameObject;
var HitMetal : GameObject;

function LateUpdate()
{

 var fwd = transform.TransformDirection(Vector3.forward);

 var hit : RaycastHit;

     if (HitConcrete)
     {
     if (hit.rigidbody == "Concrete")
     var HitConcrete1 = Instantiate(HitConcrete, hit.point + (hit.normal * HitParticleSpacing), Quaternion.LookRotation(hit.normal));
     }
     
     if (HitMetal)
     {
     if (hit.rigidbody == "Metal")
     var HitMetal1 = Instantiate(HitMetal, hit.point + (hit.normal * HitParticleSpacing), Quaternion.LookRotation(hit.normal));
     }
}

It seems like you are trying to use a raycast but you are not doing it correctly.

That being said as long as your bullet, concrete wall, and metal wall all have colliders you don’t need to use a raycast.

just use

void OnCollisionEnter(Collision collision) {
    if(collision.gameobject.tag=="Concrete"){
        //do something
    }
    else if(collision.gameobject.tag=="Metal"){
        //do something
    }
}

NOTE: this is untested code and is just to give you the basic idea.