Sorry if the title didn't make much sense, it's kind of tough to explain what I am trying to achieve.
I am working on a game that requires a placement system. Everything works fine, except for the boundaries of the player's plot.
At first, I calculated this by taking the position of the plot, subtracting that by the size of the plot divided by two. Then, I subtracted from that with the size of the object the player is trying to place down and divided that by two.
If this is hard to picture in your head, here is basically everything I explained above:
maxX1 = (workspace.Tycoons.Tycoon1.Base.Position.X - workspace.Tycoons.Tycoon1.Base.Size.X / 2) + ghost.HitBox.Size.X / 2
maxX2 = (workspace.Tycoons.Tycoon1.Base.Position.X + workspace.Tycoons.Tycoon1.Base.Size.X / 2) - ghost.HitBox.Size.X / 2
maxY1 = (workspace.Tycoons.Tycoon1.Base.Position.Z - workspace.Tycoons.Tycoon1.Base.Size.Z / 2) + ghost.HitBox.Size.Z / 2
maxY2 = (workspace.Tycoons.Tycoon1.Base.Position.Z + workspace.Tycoons.Tycoon1.Base.Size.Z / 2) - ghost.HitBox.Size.Z / 2
Probably not the best way to do it, but that's why I'm here in the first place :P!
While that works (sort of), if I ever had an object that was not in a perfect square shape, and I rotated it, then tried to place that object at the edge, it would think that it was not rotated.
Again, that's probably not explained very well so here is an image.
Here is an image of the object not rotated 90 degrees.
Here is also a GIF to better demonstrate.
As you can see, the object is being stuck two units from the edge. (One unit is 2x2 studs)
Now, here is the actual question: how do I fix this? What should I know, and what should I be doing?
If you need any more information, just ask in the comments.

6 comments
This is a really good question! Unfortunately I'm not too much of a math wiz. I believe this relates to how the Size vector is local (it's relative to a point within the object itself) whereas you want to use it to find corners that are in the global space (in the world). Keep trying to get this answered
Thanks! I'm not much of a math wiz either, but hopefully someone can answer.
I'm having a lot of difficulty understanding what you are trying to do? Could you try explaining it again another way?
I tried to explain my best. I think it would be best if you could try it out for yourself. Join the game, hit E and place down any upgrader, try placing it at the edge of the plot and try rotating it all ways. https://www.roblox.com/games/1386550012/top-secret
It's currently closed to visitors?
Oh, my friend did that. It should be open now.