Hm, I’ve noticed that looping transparency can be laggy sometimes. Is it possible to tween the transparency? I already have the tween arguments set up, but how do I get the whole model as one variable?
local TweenService = game:GetService("TweenService")
local TweenInfo = TweenInfo.new(1) -- Time to tween
local MyStand = ...
for i,v in pairs(MyStand:GetDescendants()) do
if v:IsA('BasePart') then
TweenService:Create(v, TweenInfo, {Transparency = 1})
end
end
@Legoracer didnt play the tween
TweenService:Create(v, TweenInfo, {Transparency = 1}):Play()
And no you cant Tween a model at once but if you do the for loop it actually wouldnt be noticable.
Thanks for noticing that, I type most stuff in forum editor so its hard to see everything.
Wrapping it in a Spawn function should work fine
for _,v in pairs(Mystand:GetDescendants()) do
if v:IsA(“BasePart”) then
spawn(function()
for f = 1,0,-0.5 do
wait()
v.Transparency = f
end
end)
end
end
It works fine, but how do I ignore the HumanoidRootPart? I want it to be invisible at all times.
I would suggest you using a function for the fading part
I already have the transparency tween working fine and smoothly, I just need to know how to ignore the HumanoidRootPart to stay invisible at all times.
Name the part the same thing and check if their names is that name
Yeah but if I do that, then that’d mean I would have to rename the limbs too and that would break the whole dummy
HumanoidRootPart is normally marked as a PrimaryPart or the RootPart property of the Humanoid.
You can also just iterate and ignore invisible parts since HumanoidRootPart is already transparent.
It doesn’t work, the transparency is still at 0.
I’m not sure how to ignore invisible parts, how would I go about it?
Ignore it when tweening transparency to 0. To ignore invisible parts you just check if part.Transparency == 1
So like this?:
if v:IsA(‘BasePart’) or v:IsA(‘Decal’) and v.Transparency == 1 then
Why the and? Now you are only using invisible parts.
Oh I thought you said to check if part.Transparency == 1, so just put an and there. I’m not sure what else to do.
Well what else do you need to do?
if part.Transparency == 1 --[[And whatever else you need to check]] then continue end
should work just fine if placed in the beginning of your loop.
Use ~= instead of == to ignore Transparent parents