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)

3 comments

0

mouse.TargetFilter = i

0

what i am trying to make it go were the mouse it going

0

"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.