ok so im playing around with the machine gun script at the moment and i would like to add bullet holes where the raycast hits. make them disappear after about 30 seconds or so. how do i do this? ive got the decal texture, do i make a prefab or game object of the decal as a plane and spawn it where the raycast hits? any help im new to this stuff.
bumpity bump
Check the new BootCamp demo which was released with Unity3 . They have a really good decal for bullet holes depending on where you shoot the bullet -(wood/metal etc).
hi, thanks for the reply, i checked it out, and i can see how there ding it, but all i want to do is spawn a 2d texture where the raycast hits, for now im not worried if they spawn on every collider i just want it working.
It’s actually really easy for a basic bullet hole. Have a bullet hole game object and add this after your impact effect code.
GameObject newBulletHole = Instantiate(bulletHole, contact, rotation) as GameObject;
Where bulletHole is your 2d bullet hole gameobject, contact is the raycast hit point, rotation is based on the hit normal.