Hvxbyte
|
  |
| Joined: 19 Aug 2015 |
| Total Posts: 410 |
|
|
| 02 Sep 2015 01:20 PM |
Why isn't this working for me? The parts are 'overlapping'
for _, connected in next, territory:GetTouchingParts() do if connected.Name == "Fog of War" then connected:Destroy(); end end
No output errors; just won't destroy the parts. I tried printing the name, and it only printed the player's capital that was on the territory. |
|
|
| Report Abuse |
|
|
iPhynx
|
  |
| Joined: 25 Jul 2011 |
| Total Posts: 3271 |
|
|
| 02 Sep 2015 01:23 PM |
| Does that API even exist? Meh. |
|
|
| Report Abuse |
|
|
Hvxbyte
|
  |
| Joined: 19 Aug 2015 |
| Total Posts: 410 |
|
|
| 02 Sep 2015 01:30 PM |
It's either GetTouchingParts or GetConnectedParts, and I'd rather stick with GetTouchingParts considering everything is set up. GetConnectedParts only returns parts connected via joints, where GetTouchingParts returns parts that intersect with the part you're using the function on.
However, it won't work for some reason. |
|
|
| Report Abuse |
|
|
Hvxbyte
|
  |
| Joined: 19 Aug 2015 |
| Total Posts: 410 |
|
|
| 02 Sep 2015 01:30 PM |
http://wiki.roblox.com/index.php?title=API:Class/BasePart/GetTouchingParts
They have a visual example on that page. |
|
|
| Report Abuse |
|
|
Hvxbyte
|
  |
| Joined: 19 Aug 2015 |
| Total Posts: 410 |
|
| |
|
Hvxbyte
|
  |
| Joined: 19 Aug 2015 |
| Total Posts: 410 |
|
|
| 02 Sep 2015 02:24 PM |
https://scriptinghelpers.org/questions/22255/gettouchingparts-not-returning-the-parts-intersecting
I'm not sure if that'd make a difference, but the snippet of code is there. |
|
|
| Report Abuse |
|
|
|
| 02 Sep 2015 02:44 PM |
| Both have to be CanCollide = true. |
|
|
| Report Abuse |
|
|
Hvxbyte
|
  |
| Joined: 19 Aug 2015 |
| Total Posts: 410 |
|
|
| 02 Sep 2015 03:36 PM |
| Oh my god! I made them CanCollide false! Thank you! |
|
|
| Report Abuse |
|
|