andreas98
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 246 |
|
|
| 26 Feb 2012 08:07 AM |
Hi, can anyone help me with a script that find's the nearest part in a radius of 100 studs?
~Andreas98~ |
|
|
| Report Abuse |
|
|
andreas98
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 246 |
|
| |
|
andreas98
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 246 |
|
| |
|
| |
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 26 Feb 2012 09:50 AM |
Use region3
"Bro five! Wear this to let everyone know you think they deserve a high five." |
|
|
| Report Abuse |
|
|
noobkid
|
  |
| Joined: 17 Sep 2007 |
| Total Posts: 649 |
|
|
| 26 Feb 2012 09:55 AM |
@nate890
region3 can be efficient but it may give different result.. '.'=find '[]'=wont find
i.e: region3 radius [B]..... ......... ......[A] magnitude radius [][][][. [][...... []....... ......[A] |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 26 Feb 2012 09:57 AM |
That was a horrible diagram. Using magnitude, you'd need to use recursion.
"Bro five! Wear this to let everyone know you think they deserve a high five." |
|
|
| Report Abuse |
|
|
noobkid
|
  |
| Joined: 17 Sep 2007 |
| Total Posts: 649 |
|
|
| 26 Feb 2012 10:03 AM |
| I know that's horrible.. but I can't make better one which is text-based :P |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 26 Feb 2012 10:07 AM |
Region3: x x x x x x x x x x x x + x x x x x x x x x x x x Magnitude: o o x o o o x x x o x x + x x o x x x o o o x o o
"Bro five! Wear this to let everyone know you think they deserve a high five." |
|
|
| Report Abuse |
|
|
noobkid
|
  |
| Joined: 17 Sep 2007 |
| Total Posts: 649 |
|
|
| 26 Feb 2012 10:13 AM |
| My one was just one quarter of the coordinates |
|
|
| Report Abuse |
|
|
andreas98
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 246 |
|
|
| 26 Feb 2012 11:38 AM |
| I'am not so good to use region3 yet.. Can anyone maybe post a script? :) |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 26 Feb 2012 11:39 AM |
Don't use Regoin3, use .magnitude.
~When life gives you lemons, you say 'I ain't even mad'.~ |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 26 Feb 2012 11:42 AM |
People don't know what Region3 is so they suggest the thing they do know; making your outcome bias,
"Bro five! Wear this to let everyone know you think they deserve a high five." |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 26 Feb 2012 11:43 AM |
| Well, even if you used a region3 to get a rough list of the parts to use magnitude checks on it wouldn't work because FindPartsInRegion3 returns at most only a small number of parts, and there would probably be more parts than that in the 100 stud radius, so it would have a good chance of missing the true nearest part some of the time. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 26 Feb 2012 11:45 AM |
Oh, read 100 as 10. Berr.
"Bro five! Wear this to let everyone know you think they deserve a high five." |
|
|
| Report Abuse |
|
|
andreas98
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 246 |
|
|
| 26 Feb 2012 12:00 PM |
| Okay.. So could anyone make/find a script that find's the nearest part? I don't really see the difference from region3 and magnitude :) |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 26 Feb 2012 12:03 PM |
I'll make a reference list for you;
Region3: http://wiki.roblox.com/index.php/Region3 Put to use: http://wiki.roblox.com/index.php/FindPartsInRegion3 http://wiki.roblox.com/index.php/FindPartsInRegion3WithIgnoreList_(Method) Magnitude: http://wiki.roblox.com/index.php/Magnitude Recursion: http://wiki.roblox.com/index.php/Recursion
"Bro five! Wear this to let everyone know you think they deserve a high five." |
|
|
| Report Abuse |
|
|
andreas98
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 246 |
|
|
| 26 Feb 2012 01:43 PM |
| I made my own perfectly working script now :D Thanks for posting though. |
|
|
| Report Abuse |
|
|