I have a wall that i am using to test bullet decals on. I placing them with a Raycast. Now the decals never show unless i literally move my character up close to the wall until my camera is viewing though the wall. is this a clipping issue?
//Fire Mechanisms.
if(Input.GetButtonUp("Fire1"))
{
hitray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f,0));
if (Physics.Raycast(hitray, out hit, 1000.0f))
{
point = hit.point;
Spawn.transform.LookAt(point);
print(hit.collider.name);
if (hit.collider.transform.CompareTag ("Wall"))//place decals when it hits the tag wall
{
GameObject bulletHole = (GameObject)Instantiate (BulletHole, hit.point, transform.rotation);
bulletHole.transform.parent = hit.collider.transform;
}
Health enemyHealth = hit.transform.GetComponent<Health>();
if(enemyHealth != null)
{
enemyHealth.Damage(damage);
}
Debug.Log (hit.transform.name); // logs it into the console
}
Id attach an image but i dont meet the requirements of the 524Kb even though the image is 517Kb