Ok im having a problem with bullet holes, my bullet hole decal is fine and all that but… when i shoot a box or barrel i want it to attach so that it is “part of the box” if that makes sense…
2 options:
Replace the box/barrel with a “shot” box/barrel at the same position. I.e. a prefab with the decal already applied.
Or, parent the box to the decal using this:
void Parent( GameObject parentOb, GameObject childOb )
{
childOb.transform.parent = parentOb.transform;
}
Taken from http://answers.unity3d.com/questions/145299/how-do-you-add-a-child-through-code.html