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 » Scripters
Home Search
 

Re: :GetTouchingParts()

Previous Thread :: Next Thread 
Hvxbyte is not online. 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 is not online. iPhynx
Joined: 25 Jul 2011
Total Posts: 3271
02 Sep 2015 01:23 PM
Does that API even exist? Meh.
Report Abuse
Hvxbyte is not online. 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 is not online. 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 is not online. Hvxbyte
Joined: 19 Aug 2015
Total Posts: 410
02 Sep 2015 02:03 PM
Bump.
Report Abuse
Hvxbyte is not online. 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
EchoReaper is not online. EchoReaper
Joined: 14 Oct 2008
Total Posts: 4323
02 Sep 2015 02:44 PM
Both have to be CanCollide = true.
Report Abuse
Hvxbyte is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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