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: Retrieving object by position

Previous Thread :: Next Thread 
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
23 Dec 2012 01:08 AM
How would I do so?
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
23 Dec 2012 01:10 AM
print(game.Workspace["ObjectName"].Position)
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
23 Dec 2012 01:11 AM
No, that would be getting the object's position, not finding an object by a certain position.
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
23 Dec 2012 01:12 AM
Oh!

c = game.Workspace:GetChildren()
for i =1,#c do
if c[i]:IsA("Part") and (c[i].Position = Vector3.new(0,0,0)) then
print("yolo")
end
end
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
23 Dec 2012 01:13 AM
c = game.Workspace:GetChildren()
for i =1,#c do
if c[i]:IsA("Part") and (c[i].Position == Vector3.new(0,0,0)) then
print("yolo")
end
end
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
23 Dec 2012 01:16 AM
Did it work?
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
23 Dec 2012 01:18 AM
Well, in my game it will be checked as often as a second.. looping through potentially ten thousand bricks will cause a lot of lag.. I'm hoping for a more efficient solution.
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
23 Dec 2012 01:19 AM
well, I tried.
Report Abuse
crazytomato4 is not online. crazytomato4
Joined: 09 Feb 2011
Total Posts: 1368
23 Dec 2012 01:22 AM
use whatever that method is that came out when raycasting came out. the one that finds all parts in a certain area. its in workspace. too lazy to look at the wiki. it probably does the same thing as above, but its c-side so its faster.
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
23 Dec 2012 01:23 AM
FindPartsInRegion3?
and yay you're here. don't leave us.
Report Abuse
crazytomato4 is not online. crazytomato4
Joined: 09 Feb 2011
Total Posts: 1368
23 Dec 2012 01:24 AM
yeah that one i think

and im not here. its all your imagination.
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
23 Dec 2012 01:24 AM
omg :(
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
23 Dec 2012 01:38 AM
02:36:04 - Workspace.Script:5: ambiguous syntax (function call x new statement) near '('

5    local hit1 = game.Workspace:FindPartsOnRegion3(Region3.new(brick.Position + Vector3.new(brick.Size.x, 0, 0), brick.Position + Vector3.new(brick.Size.x, 0, 0)))
Report Abuse
gametastic100 is not online. gametastic100
Joined: 15 Jun 2011
Total Posts: 1286
23 Dec 2012 01:40 AM
umad?
Report Abuse
gametastic100 is not online. gametastic100
Joined: 15 Jun 2011
Total Posts: 1286
23 Dec 2012 01:47 AM
[ Content Deleted ]
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
23 Dec 2012 01:50 AM
FindPartsInRegion3.

Not FindPartsOnRegion3
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
23 Dec 2012 01:52 AM
Oh, that's one of my problems. I think I can do the rest.
Thanks.
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
23 Dec 2012 01:55 AM
Glad to help.
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