x


See the size of an overlap sphere

Is there a way to visibly see how large an overlap sphere is? As far as I can tell it given no indication of units for the radius given and since its an invisible physics object I can't really see how large it actually is. It keeps being to large and I can't tell how big it really is.

more ▼

asked Jan 20 '12 at 09:15 PM

Proggin_Barnes gravatar image

Proggin_Barnes
36 4 6 13

(comments are locked)
10|3000 characters needed characters left

1 answer: sort newest

You can use the Gizmo DrawSphere to see the sphere in the Scene: http://unity3d.com/support/documentation/ScriptReference/Gizmos.DrawSphere.html

That needs to go in the OnDrawGizmos or OnDrawGizmosSelected methods.

private void OnDrawGizmosSelected() {
    Gizmos.color = Color.red
    //Use the same vars you use to draw your Overlap SPhere to draw your Wire Sphere.
    Gizmos.DrawWireSphere (transform.position + m_Position, m_Radius);
}

If you want to see it in the Player, the easiest way would probably be to Instantiate a Sphere prefab at the exact same dimensions of your OverlapSphere. I do not think OverlapSphere has any kind of built in way of doing this.

more ▼

answered Jan 20 '12 at 10:00 PM

Thom Denick gravatar image

Thom Denick
1.9k 13 20 38

(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:

x36

asked: Jan 20 '12 at 09:15 PM

Seen: 840 times

Last Updated: Jan 20 '12 at 10:00 PM