Hey, in this game all the grids which can be built upon have a different rotation, I have already wrote the script which properly rotates my furniture items so that they match the grid, as shown below:
RunService:BindToRenderStep("PlacementSession", 1, function()
-- Away from character.
local CFramePosition = Player.Character.PrimaryPart.CFrame
CFramePosition *= BuildSystem.AwayFromPlayer
-- Implement Height Fixes
-- Changes the y value to be just above the grid.
CFramePosition = PlacementSession.PlacementUtilities.adjustToGridTop(CFramePosition, self.TransparentModel.PrimaryPart, self.Grid)
-- Implement Rotation
CFramePosition = CFrame.new(CFramePosition.Position) * self.Grid.CFrame.Rotation
CFramePosition *= CFrame.Angles(0,math.rad(self.Rotation),0)
-- Needed:
-- Snap to grid
-- Render.
self.TransparentModel:SetPrimaryPartCFrame(CFramePosition)
end)
I now need a way to snap the CFrame to my grid, all of the solutions I can find work partially but after some rotations the CFrames position looses sync with my parts texture / grid so it looks broken.
Thanks!