Hi Thanks for you Time And Efford I Appreciate it I Have a Grid System like Minicraft When a player Clicks a Part Will be Createt but these Parts Collide with each other and glitch because I have another on is there any solution to have anchored on and prevent overlapping my solution was to set anchored off and then wait 0.1 seconds so it pushes it out and then turn anchored on but that was not the smartest Solution here is the code
part.Anchored=false wait(0.01) part.Anchored=true
thank you.
Keep anchored on for all blocks at all times, and to avoid glitching you have to create a grid system by rounding input positions to the nearest unit of the block size. I'm not sure how your current grid system works due to a lack of code given, but it shouldn't have this problem if rounded correctly.
here is my code rokedev
local part=Instance.new("Part") local cubeSize = 2.2 function convert(axis) return math.floor(axis / cubeSize) * cubeSize end local x,y,z = convert(mouseposx),convert(mouseposy),convert(mouseposz) part.Parent=script.Parent:WaitForChild("Craft") local clickdetector=Instance.new("ClickDetector") local scriptfordestroy=rightclickscript:Clone() clickdetector.Parent=part scriptfordestroy.Parent=clickdetector part.Anchored=false part.CFrame=CFrame.new(x,y,z) part.Rotation = Vector3.new(0,0,0) part.Size=Vector3.new(2.2,2.2,2.2) part.BrickColor=BrickColor.new(brickcolor) if part.BrickColor==BrickColor.new("Pastel Blue") then part.Transparency=0.4 part.Reflectance=0.4 end print("aa") part.Material=material wait(0.1) part.Anchored=false
local part = workspace.Part part.Anchored = true part.Position = Vector3.new(0, 0, 0) local part2 = part:clone() part2.Parent = Workspace part2.Anchored = false part2.Position = Vector.new(1,0.5,0)
Marked as Duplicate by youtubemasterWOW and JesseSong
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?