generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: "FindPartsInRegion3" Radial function

Previous Thread :: Next Thread 
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
01 May 2013 07:55 PM
Is there any method that behaves like FindPartsInRegion3 where, rather than detecting all parts within a specified Region3, the parts are detected within a specified radius?
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
01 May 2013 08:13 PM
I'm not sure, but if there isn't, I have one idea. Take a "Ball" part and give it the correct radius and then CFrame it to the position you want, then have a Touched event in the ball that collects everything it touched :)
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
01 May 2013 08:24 PM
That would be the least efficient and most time consuming method.
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
01 May 2013 08:30 PM
Geez. I was just trying to help.
Report Abuse
hardhatworker is not online. hardhatworker
Joined: 29 Jan 2009
Total Posts: 8518
01 May 2013 08:45 PM
I believe that would involve the making of said "radius" and then using a detect function, etc. But, as you said that is not exactly the definition of efficient. Sorry, that's all I got
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
01 May 2013 08:46 PM
It wouldn't work, either. It would collide with a few parts and then they would all explode, rendering the purpose of detecting what *used to be* there useless.

Is there any actual method that does the same thing as the cubic method, but instead of cubic: radial?
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
01 May 2013 08:48 PM
So far, the best method seems just to be to use the FindPartsInRegion3 method with the radius and then create my own radial detection method based on the parts returned from the area of the Region3.
Report Abuse
hardhatworker is not online. hardhatworker
Joined: 29 Jan 2009
Total Posts: 8518
01 May 2013 08:50 PM
I got no other ideas, sorry mate. This has interested me though, if you figure something out you should tell me
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
01 May 2013 08:51 PM
Couldn't you just make a table that adds parts that is within a distance? o-o
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
01 May 2013 08:55 PM
Test the magnitude of all the objects returned by FindPartsInRegion3. There isn't a function like it that returns parts within a sphere.
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
01 May 2013 09:13 PM
None of you understand what FindPartsInRegion3 does.
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
01 May 2013 09:34 PM
What do you mean by radial?
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
01 May 2013 09:36 PM
It returns a table with parts that are within a cube right? o-o
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
01 May 2013 09:46 PM
It returns a table of parts of which any portion are within the boundaries of the defined Region3.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
01 May 2013 10:18 PM
You're being way to uptight and just under minding whatever help you receive. To the point where such obviousness has deluded you.

Obviously there is no functioning method or algorithm in Roblox API. But Woodstauk's idea is most efficient because it uses Region3 to obtain parts in a defined cubical area, which are obtained efficiently, then you can get a spherical distance by checking magnitudes of vectors ( which is always spherical ).
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
01 May 2013 10:31 PM
Yes, but the problem is the distance between what.
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
01 May 2013 10:33 PM
Woodstauk's idea is ineffective, my idea is incomplete.
Report Abuse
SlenderStudios is not online. SlenderStudios
Joined: 16 Aug 2012
Total Posts: 76
02 May 2013 12:07 AM
a while back i had this same problem (btw im Isaiahmk989) and i was trying to make a part rendering system (which i was successful). Now there's many ways to do this but what will happen is the more accurate you want the detection to be, the more lag you get out of it. If you are detecting each part's position, no problem just use magnitude, but when a part is more that a 1x1x1, you can be out of the distance of the position, but the part will still collide with the sphere. my friend Arundel mentioned recording all the corners (verticies) of a part and if one of those is within distance, then its true, but when you have a big part, lets say a 20x20x20, you can still be within in distance without it counting thats it's in the sphere if you're in between the corners. So, the bigger the shape gets the more points you have to calculate on the shape. That's still not good though considering the time you want to render. If you take 100 parts, and you are rendering 500 points every second, it will still be laggy. With that being said, the method i did works, but its not the best. heres the link to it http://www.roblox.com/Part-Render-Script-item?id=98196892
Report Abuse
SlenderStudios is not online. SlenderStudios
Joined: 16 Aug 2012
Total Posts: 76
02 May 2013 12:10 AM
one more thing i should mention, its best to only render the detailed part of areas instead of every part, that way you cant run into the main problem of a big part not being calculated correctly. heres a example http://www.roblox.com/N-A-place?id=90425012
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
02 May 2013 02:44 PM
It doesn't matter how big the part is. Trial and error is not the solution. Doing more calculations to see if one of them might be right is stupid. There is an actual algorithm to find the closest distance on a surface to a certain point.
Report Abuse
SlenderStudios is not online. SlenderStudios
Joined: 16 Aug 2012
Total Posts: 76
03 May 2013 05:06 AM
well, what is your solution?
Report Abuse
NeoEclipse is not online. NeoEclipse
Joined: 09 Apr 2012
Total Posts: 5407
03 May 2013 06:30 AM
"Trial and Error is not the solution."

Apparently you dont know what scripting it.
Report Abuse
toshir0z is not online. toshir0z
Joined: 03 Nov 2009
Total Posts: 425
03 May 2013 09:14 AM
Using the table it returns check all the parts if they are withen a certain radius
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
03 May 2013 02:48 PM
No, Neo. You do not understand how things work, so don't attempt to make an argument. You are wrong.
Slender, if I had a solution, then I wouldn't be asking for the input of you lot.

Neo, you must be absolutely horrible at solving problems. Trial and error is not the solution. It may work sometimes, but it will take absolutely forever and will be the absolute least effective and least efficient possible method you could ever use. If you think you're going to try to argue that trial and error is the right thing to do, then you need to shut up and learn how efficiency works.
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
03 May 2013 02:49 PM
Toshir0z, stop posting when you're less than half awake.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image