I’m trying to make a MeshPart invisible when I play an animation but I can’t do it and when I run it I don’t get any error, the MeshPart location is:
Character > Left Arm > MeshPart
Client:
local frame : Frame
for _, v in pairs(frame:GetChildren()) do
if v:IsA("TextButton") then
v.MouseButton1Click:Connect(function() -- button to play the animation and hide the MeshPart (works fine for me)
local Animation = v:FindFirstChild("Animation")
Humanoid:LoadAnimation(Animation):Play()
Remote:FireServer()
end)
end
end
Server:
Remote.OnServerEvent:Connect(function(player)
local Character = player.Character
local LeftArm = Character:WaitForChild("Left Arm")
for _, v in pairs(LeftArm:GetChildren()) do
if v:IsA("MeshPart") then
v.Transparency = 0 -- does not become invisible
print(v.Name) -- It prints the name of the MeshPart without any problem.
end
end
end)