Model following mouse tends to get closer to camera

Not really sure why this is happening. any fixes?
Local Script

local Item = game.ReplicatedStorage.Placeables.landmine

local mouse = game.Players.LocalPlayer:GetMouse()

local player = game.Players.LocalPlayer

script.Parent.Equipped:Connect(function()
	local Place = Item:Clone()
	Place.Parent = workspace
	local main = Place.Main
	mouse.Move:Connect(function()
		main:PivotTo(CFrame.new(mouse.Hit.p)) 
	end)
	script.Parent.Unequipped:Connect(function()
		Place:Destroy()
	end)
	script.Parent.Activated:Connect(function()
		script.Parent.Place:FireServer(Item, mouse.Hit.p)
		Place:Destroy()
		script.Parent:Destroy()
	end)
end)


Set mouse.TargetFilter to main

1 Like

Returned a nil value

script.Parent.Equipped:Connect(function()
	local Place = Item:Clone()
	Place.Parent = workspace
	local main = Place.Main
	mouse.TargetFilter(main) ---------HERE
	mouse.Move:Connect(function()
		main:PivotTo(CFrame.new(mouse.Hit.p)) 
	end)
	script.Parent.Unequipped:Connect(function()
		Place:Destroy()
	end)
	script.Parent.Activated:Connect(function()
		script.Parent.Place:FireServer(Item, mouse.Hit.p)
		Place:Destroy()
		script.Parent:Destroy()
	end)
end)

mouse.TargetFilter = main 

insertrandomtexthere

2 Likes

worked but didnt fix the issue of the model getting closer to the camera

Setting the whole model as filter worked

thanks guy setting the whole model as filter worked

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.