Need help with script

mouse.Button1Down:Connect(function()

local FakePart = Instance.new("Part")
FakePart.Name = "FakePart"
FakePart.Parent = workspace
FakePart.CanCollide = false
FakePart.Anchored = true
FakePart.Transparency = 0.5

while wait(.1) do
if mouse.Hit.Position then
FakePart.Position = mouse.Hit.Position
elseif not mouse.Hit.Position then
FakePart.Position = mouse.Hit.Position
end
end
end)

https://i.gyazo.com/5647adcdde6252eceacff9c23a9ba59e.gif

why fakepart coming the current camera ?

what is happening is that when you create the part, your mouse.hit.position will be now on the part. For this to stop happening your mouse needs to ignore the part you are creating using mouse.TargetFilter = FakePart

2 Likes

Where should I change? can you show if possible

right after you do mouse = Player:GetMouse()