|
| 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 |
|
|
| |
|
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 |
|
|
| |
|
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
|
  |
| 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 |
|
|