Essentially, I’m Instantiating a bullet hole texture GameObject on a rayCast hit point, which works fine for floors and objects where the only the Y axis needs to be adjusted (due to clipping).
But this does not work as well for objects like cubes with 4 sides, as one side will have the bullet hole come up fine, but the parallel side will have the texture being 0.01 (float Adjustment) units INSIDE the cube because of my adjustments.
I know what i need to do, I just don’t know how to do it.
Here is the main part of the code:
//Hit texture
Vector3 holeAdjust = new Vector3((hitPoint.x + Adjustment), (hitPoint.y + Adjustment), (hitPoint.z + Adjustment));
Instantiate(bulletHole, holeAdjust, Quaternion.FromToRotation(Vector3.up, hit_Info.normal));
And here’s what it looks like (i shot at all side of the cube)