Hello! I need your help. When I click on board my part that script creates spawns on top of that board. I need your help to make it spawn where you click it not on top. Here is everything that is in the script.
script.Parent.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
if mouse.Target.Name == "DrawBoard" then
local instspr = Instance.new("Part")
instspr.Parent = mouse.Target
instspr.Position = mouse.hit.p
instspr.Anchored = true
instspr.CanCollide = false
instspr.BrickColor = BrickColor.new("Institutional white")
instspr.Name = "DrawPix"
instspr.FormFactor = Enum.FormFactor.Custom
instspr.Size = Vector3.new(0.2, 0.2, 0.2)
instspr.BottomSurface = Enum.SurfaceType.Smooth
instspr.TopSurface = Enum.SurfaceType.Smooth
end
end)
end)

3 comments
Can you explain how this works?
Works.
Please explain your answer in the future.