So, I was trying to make a tool that when you chose a certain thing, such as a part, it would show up and follow mouse, then once you click it would place it, how could I do this?
Well, if you want a simple way to make a part follow the player's mouse you can do this:
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local part --= whatever part you want to move local render = game:GetService("RunService").RenderStepped local moving local function movePart(currentPart) moving = true render:connect(function() if moving then currentPart.CFrame = CFrame.new(mouse.Hit.p) end end) end movePart(part) --you can call this whenever you want to move another part mouse.Button1Down:connect(function() moving = false --stops moving the part end
Closed as Not Constructive by Shawnyg, AwsomeSpongebob, and rexbit
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?