- What do you want to achieve? Keep it simple and clear!
A selection box that can select parts and highlight them.
- What is the issue? Include screenshots / videos if possible!
The selection box doesn’t disappear when user isn’t clicking and dragging.
robloxapp-20230818-1132034.wmv (786.6 KB)
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried looking at the forums and the documentation to see what is the problem. I have a feeling that the problem has to do with one of these functions.
mouse.Button1Up:Connect(function()
if pointBegin and pointEnd then
local selectedParts = Search(
workspace.Blue.Cities:GetChildren(), partPosBegin, pointEnd
);
selectedCity(cities,selectedParts)
warn(selectedParts)
end
destroyBox()
end)
mouse.Move:Connect(function()
if pointBegin then
local endPos = mouse.X
local endPosY = mouse.Y
pointEnd = Vector2.new(endPos, endPosY)
createBox(pointBegin.x, pointEnd.x, pointBegin.Y , pointEnd.y)
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.