A placement system does not “require” raycasts as it does not only happen on the client. Your module fails to account for the developer’s need to validate and ensure the position the client has provided is grid-aligned. The functions to grid-align & perform raycasts should be decoupled for this reason.
Correcting this since I did not realize that your module does actually have separate methods for raycasting and grid alignment. Though I still stand by the opinion that raycasts are not a requirement for a grid system.
Also as an FYI, this resource would be a bit more useful to developers if the Github repository was properly setup to work with Rojo.
thanks for your suggestions! ill try setting up rojo although i have never tried it before :3
also, if you’re worried about the grid alignment server-side, instead of sending the cframe over, you could send every parameter needed to replicate the function there. although it might be a little bit complicated to figure out the ray if you’re using GetCFrameAtMousePosition, i’ll probably add better support for this in the future. thank you! :3
you could use the NormalBased configuration (as explained in the documentation) which makes placement relative to normals instead of the ray hit for this use case :3
though, now that i’m realizing it, i forgot to add support for smaller sizes while this is turned on. i will try to add support for it asap!
How would I disable the overlapping of the block? like, if I aim at the front area of the wedge, it’ll clip into the white wedge [or the top], but any other area it’d build below.
Also this:
Whenever I rotate my block, it offsets now.
I find that the orientation not being relative to its surface grid, is it supposed to do that?
Or did i do something wrong?
local LibreGrid = require(script.LibreGrid)
local Setup = {
RaycastParams = nil,
ForceAlignedOutput = false,
AllowFaceAlignment = true,
NormalBased = false,
WhitelistedNormals = nil,
RoundingMethod = math.floor,
}
while wait() do
local block = workspace.Folder.Test
local Result = LibreGrid:GetCFrameAtMousePosition(
block,
1,
CFrame.new(block:GetPivot():ToOrientation()),
Setup
)
workspace.Folder.Test:PivotTo(Result)
end
It’d be helpful if you could provide us information of setting up and possible coding examples and what they do.
Take your time, this could be a game changer.
i can see why this happens. libregrid is rounding the position to the grid. however, the slope would require the block to get a bit off the grid to snap to that surface.
im not sure if i want to keep this behavior or allow parts to stay a bit off to snap to the surface. though, the current behavior facilitates sanity-checking on the server.
also sorry for the delayed response i didn’t see ur post