-- Create smoke for specified part (being destroyed)	

local function createSmoke(targetPart)
	local pos = Vector3.new(0, 0, 0)
	local size = 3
	if targetPart:IsA("Model") and targetPart.PrimaryPart then
		--local plate = targetPart:FindFirstChild("Plate", true)
		local plate = targetPart.PrimaryPart
		pos = plate.Position
		size = 1*plate.Size.X
	else
		pos = targetPart.Position
		size = 1*targetPart.Size.X
	end	
	
	local smokePart = Instance.new("Part")
	smokePart.Name = "SmokePart"
	smokePart.Transparency = 1
	smokePart.CanCollide = false
	smokePart.Anchored = true
	--smokePart.Position = getPositionRelativetoBase(smokePart, pos) + Vector3.new(0, 1, 0)
	smokePart.Position = pos + Vector3.new(0, 1, 0)
	smokePart.Size = Vector3.new(1, 1, 1)
	smokePart.Parent = mapManager.getMap()
	
	local smoke = Instance.new("Smoke")
	smoke.Parent = smokePart
	smoke.RiseVelocity = 0
	smoke.Size = size
	
	DebrisService:AddItem(smokePart, 0.75)
end
