Hi there fellow devs! Today I am looking to create my own building system to place objects, but I have a couple of issues, first of, when I try to place a Dropper at my cursor’s location, the dropper keep moving even though the cursor is not moving… and I really don’t know how can I make it only placeable on the black tiles, I don’t want it to be placed anywhere else, I would need a couple of explaining of y’all and help to finish this little project of mine which seems so big to me, I need to fix the fact that It can be ONLY placeable on the black tiles and to fix the object position, Thanks you guys for your answers!
local function round(vector, grid)
print(Placed.Item.Hitbox.Size.Y / 2)
return Vector3.new(
math.floor(vector.X / grid + 0.5) * grid,
(Placed.Item.Hitbox.Size.Y / 2) + workspace.Base.BasePlates.Baseplate.Position.Y + 0.5,
math.floor(vector.Z / grid + 0.5) * grid
)
end
local Changed = UserInputService.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement and Placed.Item then
local hit, pos, normal = workspace:FindPartOnRay(Ray.new(Mouse.UnitRay.Origin, Mouse.UnitRay.Direction * 100), Player.Character)
Placed.Item:SetPrimaryPartCFrame(CFrame.new(round((pos + normal), 2)))
end
end)
