I’m attempting to fix the current but I’m having where users can’t connect there walls properly. I’d like the user to be able to create clean cut corners that connect properly and cleanly with other walls.
Here is an example of what I have so far and how it doesn’t properly connect corners…
This was a consideration that I ended up shooting down when making this. The entire point of this project is to allow my players to have complete control over building with ease and I feel like adding limitations like that will really take away from the grand scheme of things.
What I would recommend is checking if two walls collide (and approximating what end they are touching at, using position, size and rotation) and then doing math to re-position it slightly so that they connect how you want them to.
wouldn’t you just create a variable for the last wall placed, then connect the whatever code is inside the ResizeAlign to the new wall placed? haven’t looked inside the ResizeAlign code so i’m not sure if that would work or not…
Perhaps a cylinder at the end where a new wall is created from a corner will fix this problem? It’s not elegant but at least works.
Otherwise, you could deal with size maths after placing the 2nd wall. Assume first wall is A and other wall is B. Then we have to find the outer corner that ‘could’ connect between A and B. Note that A and B requires the face facing ‘outwards’.
After that, calculate magnitude between the edge of the wall opposite to the corner to the edge of the corner. Subtract the length of the side and put them into two different variables and add them to the size of the length of the wall. We have the wall sizes!
Now when the size is acquired, you have to reposition it too. Local space CFraming would fix this problem. Take the half of the size of aforementioned variables(the extension) and move them towards the corner using CFrame.
Note: This may contain a lot of decimals after creation of the corner.
I hope this solves the problem trying to read the ResizeAlign code.
Another thing you can do instead is have a GUI which you can decide the numbers such as grid size, rotation angles, etc. Might be useful and allow to build with ease and could possibly fix the issue though…
Edit: Reposted since I accidentally replied to wrong post
For sized corners, you could have additional parts to the corners. Imagine a sequence pattern. It has a start and end sequence. Using CFrame to determine where the end is(and offsetting from it) can probably create those sized corners.
If this is not what you’re looking for, I must have misinterpreted the expected result.
My OOC contains two values if this is what you’re referring to,
self.EndPos
self.StartingPos
I’m not entirely sure what you’re talking about with additional parts to the corners? I’m just looking to scale one end up or down in order to meet the other part and make a smooth corner without any overlapping
You need to base your position/rotation on the different corners depending on if the relative rotation is positive or negative, instead of the center (grid snap).