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: Merging two or more identical touching parts to one.

Previous Thread :: Next Thread 
1518NICENICKEY is not online. 1518NICENICKEY
Joined: 29 Apr 2009
Total Posts: 1136
18 Oct 2013 10:59 AM
I have a map that users can create for a mini game.
The only issue was that 85% of the map builders left not resizing parts, they instead use the same sized part. Is there a way to have one part thats besides another part to conjoin and form one part.
Like this..
[] = Part
[ . . . . ] = Part

[] [] [] [] [] [] [] [] [] [] []
[] ... [] [] .. [] [] ... [] [] []

would change to

[. . . . . . . . . . . . . . . . . . ]
[] ... [ . .] .. [ . .] ... [ . . .]
Report Abuse
1518NICENICKEY is not online. 1518NICENICKEY
Joined: 29 Apr 2009
Total Posts: 1136
18 Oct 2013 11:35 AM
Fuzrodah.
Report Abuse
Meleos is not online. Meleos
Joined: 13 Oct 2013
Total Posts: 171
18 Oct 2013 11:44 AM
I'm not going to give you the script. But here is how it would be accomplished. Check for adjacent parts using whichever method you prefer. A loop, a ray, or region3. All suffice.

Check if the adjacent part has all of the exact same properties as the original.

Find if two axes on each part are congruent. If there is only one, or less, then it does not match up enough to be merged.

Resize original part along the desired axis 1/2 the width of the adjacent part plus the distance the adjacent part is away from the original part. (Unless the distance is greater than 1/2 of the adjacent part's size. Then it doesn't match up enough to be merged.)

re-CFrame the original part along the axis you resized it on by half of the amount you resized it by.

Remove the adjacent part.

Yours truly, Meleos
Report Abuse
1518NICENICKEY is not online. 1518NICENICKEY
Joined: 29 Apr 2009
Total Posts: 1136
18 Oct 2013 11:50 AM
@Meleos.
Oh just gawd.
Report Abuse
Meleos is not online. Meleos
Joined: 13 Oct 2013
Total Posts: 171
18 Oct 2013 12:01 PM
Haha, exactly why I didn't want to write it. I'm feeling lazy as of right now. But I hope that helps anyone who may need it.

Yours truly, Meleos
Report Abuse
Meleos is not online. Meleos
Joined: 13 Oct 2013
Total Posts: 171
18 Oct 2013 12:03 PM
I have to correct myself though.

"Resize original part along the desired axis 1/2 the width of the adjacent part plus the distance the adjacent part is away from the original part. (Unless the distance is greater than 1/2 of the adjacent part's size. Then it doesn't match up enough to be merged.)"

In the parenthesis it should say, "Unless the distance is greater than 1/2 of the adjacent part's size plus 1/2 of the original part's size. Then it doesn't match up enough to be merged."

Yours truly, Meleos
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