x


Overlap Sphere not working properly

Why is it that my code:

var colliders[] = Physics.OverlapSphere( MyPastPosition, 150.0);

does not work properly?

What happens is that everything works fine but it never puts the sphere at the position vector I choose, always at the center of the player (first-person-shooter). Plus the radius I assign act very strange. It wont affect objects in a radius of 15 or so, only if I set the radius to about 150 or more??

I really appreciate the help, Thanks!

more ▼

asked Feb 21 '10 at 01:32 PM

Yisreal gravatar image

Yisreal
115 8 9 12

Physics.OverlapSphere does work properly. It's not really possible to tell what you're doing wrong with the info you provided; more code might help.

Feb 21 '10 at 02:25 PM Eric5h5
(comments are locked)
10|3000 characters needed characters left

2 answers: sort oldest

It really depends on how you define MyPastPosition; since it is the position that doesn't work. as far as the radius weirdness goes it could just be that you need a large radius value, or that there is a problem with what you do to the colliders once they're returned from the Overlap Sphere. Sorry if that doesn't help but it's difficult to tell what the problem is with this little information.

more ▼

answered Feb 21 '10 at 02:40 PM

Jason_DB gravatar image

Jason_DB
1.9k 4 14 36

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

I just found out about OverlapSphere this morning, but check out this thread, I think it might help :) http://answers.unity3d.com/questions/30078/overlapsphere-giving-me-trouble

Also I see you posted that ove a year ago? Maybe your not even havling trouble with it :D

more ▼

answered Jan 31 '11 at 04:27 PM

Wes 1 gravatar image

Wes 1
40 18 18 22

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

x1864
x1682
x81

asked: Feb 21 '10 at 01:32 PM

Seen: 2793 times

Last Updated: Jun 14 '10 at 06:31 AM