Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i fix when a part keeps coming into screen?

Asked by 5 years ago
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)
0
mouse.TargetFilter = i EpicMetatableMoment 1444 — 5y
0
what i am trying to make it go were the mouse it going helleric -3 — 5y
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. chess123mate 5873 — 5y

Answer this question