I am trying to make a clone a Players Character and make it semi-transparent (like a ghost) once they press the “E” key, the problem is however that the Character clones and the parts and textures become semi-transparent but the accessories of the Character is not. Is there a way to loop through, get the accessories, then loop through each accessory and get its mesh part furthermore changing the transparency of the mesh part and consequently the the accessory?
Sorry for the possible grammatical errors, Its quite late when I am posting this.
Code so far:
local character = game.Players.LocalPlayer.Character or
game.Players.LocalPlayer.CharacterAdded:Wait()
local root = character:WaitForChild("HumanoidRootPart")
game:GetService("UserInputService").InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
character.Archivable = true
local clone = character:Clone()
clone.Parent = workspace
for i,v in pairs(clone:GetChildren()) do
if v:IsA("BasePart") then
v.Transparency = 0.5
if v:IsA("Accessory") then
for i,b in pairs(v:GetChildren()) do
if b:IsA("MeshPart") then
b.Transparency = 0.5
end
end
end
end
end
end
end)
What I get when I press ‘E’: