Okay.
I am creating a building module for my game. This module allows me to build objects along an arbitrary 4x4 grid. However I have an issue. I want to only build on top of a build-base part. Much like the old Mining Tyccoon or the newer Ultimate Mining Tycoon (i think it’s called) but because all my objects are sized based off a 4x4 (x,z) base there’s a small issue with placements. I can never get it to fit into a grid like structure within the bounds of a part.
I have a solution in mind but have no idea how to implement it at all.
My potential Solution:
Have a module that creates the building base, using a total amount of objects that can be placed (i.e 50 parts creates a smaller base than 100 parts) Then store somehow each position of the center of each grid object, then when the mouse is moved around in my building service I can use the module I am creating to get the closest grid to where the mouse is at, then snap the ghost to that position.
I’m not good at math, so if someone could figure out how I could do this, I would be greatly appreciative.