in the video u can see that when i hit something a red overlay is cloned from the players character parts but the problem is its all boxes and that is a problem because people can have like accessories and that would cause it too look ugly is there any way to make it less ugly
https://gyazo.com/671a7db4c4066de80af38473362a6c0e
function module.Hit(character)
local OverlayParts = Instance.new("Folder")
OverlayParts.Name = "OverlayParts"
OverlayParts.Parent = character
Debris:AddItem(OverlayParts,0.3) --overlay duration
for i,v in pairs(character:GetChildren()) do
if v:IsA("Part") then
if not table.find(ignorelist,v.Name) then
local weld = Instance.new("WeldConstraint")
local clonedpart = v:Clone()
clonedpart:ClearAllChildren()
clonedpart.Name = v.Name
clonedpart.Material = Enum.Material.SmoothPlastic
clonedpart.Size = v.Size * 1.001
clonedpart.CFrame = v.CFrame
clonedpart.BrickColor = BrickColor.new(1, 0, 0)
clonedpart.CanCollide = false
clonedpart.Transparency = 0.5
weld.Part0 = clonedpart
weld.Part1 = v
clonedpart.Parent = OverlayParts
weld.Parent = OverlayParts
end
end
end
for i,v in pairs(OverlayParts:GetChildren()) do
if v:IsA("Part") or v:IsA("MeshPart") then
local tween1 = TweenService:Create(v,tweenInfo,{Transparency = 1})
tween1:Play()
end
end
end