Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Detecting adjacent parts/bricks?

Asked by 8 years ago

Hi, I was wondering if you guys could give me tips on how to go over detecting adjacent parts or bricks. What functions are usually used? I'm so lost. Thanks in advance!

1
Could you give more information on your current problem? Because best solution depends on the situation, sometimes you might want to use raycasting, other time touched event would work better. ZarsBranchkin 885 — 8y
0
I'll second that. You could raycast, but it could be comparatively expensive compared to what might be wanted. User#6546 35 — 8y
0
I'm intending on creating a sort of fog of war for an RTS I've been working on, it's sort of a risk-type RTS (map based). PoisonShadow8888 10 — 8y
0
Then it sounds like you should learn how to use raycasting. There is no real definitive answer or code I can give you, but check out how rays work: http://wiki.roblox.com/index.php?title=Raycasting ZarsBranchkin 885 — 8y
View all comments (4 more)
0
Thanks for the tip PoisonShadow8888 10 — 8y
0
http://wiki.roblox.com/index.php?title=API:Class/BasePart/GetTouchingParts This may help somewhat, if you don't have to be exact. Perci1 4988 — 8y
0
FindPartsInRegion3 is more likely to be helpful than raycasting for some kinds of fog-of-war BlueTaslem 18071 — 8y
0
I believe you could create a table and go game.Workspace:GetChildren() inserting them into a table then finding the magnitude of all parts within the workspace and then do something if a part has a magnitude of 2 or 3 whatever you want it to be Prioxis 673 — 8y

Answer this question