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: Most Prominent Part Help Needed

Previous Thread :: Next Thread 
cjcool12345 is not online. cjcool12345
Joined: 28 Jan 2010
Total Posts: 606
04 Jan 2013 10:25 PM
What would be the best way to find the most 'prominent' part in a region (Region3 to be specific)?

I know I could divide the region into sub-regions, but that would be double the amount of memory usage. Is there any better way?
Report Abuse
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
04 Jan 2013 10:27 PM
Are you talking about the first part located within region3? if so then use game.Workspace.Region3:findFirstChild("Part")
Report Abuse
cjcool12345 is not online. cjcool12345
Joined: 28 Jan 2010
Total Posts: 606
04 Jan 2013 10:29 PM
No. I mean the the part that is most (by size and how much the part goes into the region) in a Region3 (the datatype).
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
04 Jan 2013 10:33 PM
local ms, part = -1
for _, v in pairs(TableOfParts) do
local s = v.Size.magnitude
if s > ms then
ms = s
part = v
end
end

print( part, "is the largest part within the Region" )
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
04 Jan 2013 10:34 PM
Eh that only checks for size, not for how much it's sticking into the region.
Report Abuse
cjcool12345 is not online. cjcool12345
Joined: 28 Jan 2010
Total Posts: 606
04 Jan 2013 10:35 PM
Just what I needed, thank you!


Problem Solved.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
04 Jan 2013 10:36 PM
I can modify it for you if you want me to account for how much the part sticks into the Region.
Report Abuse
cjcool12345 is not online. cjcool12345
Joined: 28 Jan 2010
Total Posts: 606
05 Jan 2013 11:18 AM
No thank you. I think I can add that functionality.
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