so the script i have is suposed to render everything thats being hit i want to increase the radius but its not working
as you can see the upper half of the picture is what im getting but number two is what i want everything inside the camera area or the red area should be rendered
function Update () {
var hit : RaycastHit;
var charCtrl : CharacterController = GetComponent(CharacterController);
var p1 : Vector3 = transform.position + charCtrl.center;
// Cast a sphere wrapping character controller 10 meters forward, to see if it is about to hit anything
if (Physics.SphereCast (p1, charCtrl.height / 2, transform.forward, hit, 10)) {
distanceToObstacle = hit.distance;
print(distanceToObstacle);
hit.collider.SendMessageUpwards("Render", 1, SendMessageOptions.DontRequireReceiver);
}
}