x


how to increase the rayspheres radius

so the script i have is suposed to render everything thats being hit i want to increase the radius but its not working

alt text

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);

}

}

spheres.png (482.1 kB)
more ▼

asked Jun 03 '12 at 04:33 AM

zeuo gravatar image

zeuo
373 52 70 83

zeuo, did that do the trick? anything else I can help with on this topic?

Jun 04 '12 at 10:38 AM Fattie
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I don't entirely follow, BUT,

as a general point if you want to cast a "wide ray", you just cast more than one, with a gap between each.

more ▼

answered Jun 03 '12 at 02:33 PM

Fattie gravatar image

Fattie
18.9k 57 86 146

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x49
x1

asked: Jun 03 '12 at 04:33 AM

Seen: 302 times

Last Updated: Jun 04 '12 at 10:38 AM