Bullet hole Decal local position.

Hello!
I am making bullet hole decals and this is my current setup.

SpawnDecal(hit.point, Quaternion.LookRotation(hit.normal));

Thats the code I use in my raycast. hit being my raycasthit.

my SpawnDecal looks like this:

    void SpawnDecal(Vector3 pos, Quaternion rot)
    {
        GameObject decal = (GameObject)Instantiate(bulletHolePrefab, pos, rot);
    }

Now what happends is that my spawned decal is inside my object. I basically need to move it up by something like 0.001 Units Relative to my hit.point. How is this done?

Thanks, TwoTen.

You’ve already got the answer in your post! hit.normal! Hit.normal is a vector that points directly away from the hit wall.

Simply add 0.001 * hit.normal to hit.point to get something that’s 0.001 moved back from the wall you’ve hit.

1 Like

Thanks alot!