Spawn only on tag.

i have a bullet hole decal which basically spawns where my projectile hits, BUT i want it to spawn on tagged objects only. such as metal, how could i modify my script to do that? ive searched the docs couldn’t find much.

heres my script cut up.

var bulletHole : GameObject;

// create a bullet hole object at hit point and rotation
var newBulletHole:GameObject = Instantiate(bulletHole, contact.point + contact.normal * .001, rotation) as GameObject;

bump

Use tags?

Tag an object as metal and when the bullet hits it, if it’s tagged as metal, do whatever.

how do you use tags, could you explain or simple send me a link, i have looked.

in the script just use
hit.collider.tag to check the tag of the collider that the bullet has hit.

where hit is the variable, containing the hit informaion.