Looking for a better placement system script

Greetings, I’ve made a money printer placement system however I am not all too pleased with it. It hinges on mousePosition thus it clips into walls as you can see in the video

https://streamable.com/ekbums

I want to prevent it clipping into walls but I am not sure how I would go about making that happen

here’s the script

tool.Equipped:Connect(function()
		Targeting = true
	
		Area = TargetArea:Clone()
		Area.Parent = workspace
		Area.CanCollide = false
		Area.Anchored = true
	mouse.TargetFilter = Area
	
	while Targeting do
			
				local minDist = 5
				local MaxDist = 10
				local mag = (mouse.Hit.p - Root.Position).Magnitude
			
			if mag < minDist or mag > MaxDist then
				Area.Transparency = 1
				Area.Position = mouse.Hit.p + Vector3.new(0,.5,0)
					
				else
					Area.Transparency = 0.9				   
					Area.Position = mouse.Hit.p + Vector3.new(0,.5,0) 						   
			end
			
			wait(0.1) 
			end
end)

Please advise, and thank you for your time

1 Like

That’s not really what i’m going for

Here is a tutorial to a furniture system. Maybe it’s like you imagine. https://devforum.roblox.com/t/creating-a-furniture-placement-system/205509

again not really a furniture feature i am going for, this is more like a 1 thing only placement, i’m just trying to avoid people placing them in places where it would disrupt gameplay not trying to create a full blown system