local player = game.Players.LocalPlayer --- this has to be in starter pack, this is a local script
local mouse = player:GetMouse()
local toggle = false
mouse.KeyDown:connect(function(key)
if not toggle and key == "r" then
local i = Instance.new("Part",workspace)
i.Size = Vector3.new(14.53, 11.41, 1.59)
i.Anchored = true
while true do
wait()
i.CFrame = mouse.Hit
end
end
end)
COMMUNITY QUESTION
how do i fix when a part keeps coming into screen?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
mouse.TargetFilter = i
what i am trying to make it go were the mouse it going
"mouse.TargetFilter = i" is probably what you need (though feel free to explain more - you don't say much in your question). When putting a brick under the mouse cursor, the brick will become the new thing the mouse is hovering over, causing it to very quickly move towards your camera. Btw, you should have a way for the 'while true do' loop to stop executing.