Help with placement system

Right now when i hover over baseplate the hover flickers alot any help?

local players = game:GetService("Players")
local plr = players.LocalPlayer
local PosStart = game.Workspace.PosTree.PrimaryPart.CFrame
local runService = game:GetService("RunService")
wait(0.5)
local mouse = plr:GetMouse()

function ishovering(part)
	if mouse.Target == part then
		workspace.PosTree.PrimaryPart.CFrame = CFrame.new(mouse.Hit.Position)
	else
		workspace.PosTree.PrimaryPart.CFrame = PosStart
	end
end

runService.Heartbeat:Connect(function()
	local h = ishovering(workspace.Baseplate)
end)

The flickering happens because mouse.Target changes between the model you are trying to place and workspace.Baseplate.

You should use raycasts and set a custom filter.

Is there any way to avoid using raycasts?

Fixed just used target filter for mouse you have a better solution though

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