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
 

find nearest object,

Previous Thread :: Next Thread 
1Ra is not online. 1Ra
Joined: 02 May 2010
Total Posts: 2400
12 Aug 2011 08:51 AM
lets say i have a zombie, and out of a group in workspace i have to find the closest part in it,

so i can use a for loop to get all the parts then .Magnitude to judge distance,

but how can i compare closest? without having to indivually checking every part?

mabye
for i,v in pairs (game.Workspace.Paths:GetChildren()) do
if (zombie.torso.Position - v.Position).Magnitude <=

i need help finishing that.

mabye if i used region3, but how can i get it like, the center of the region is the zombies torso

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