#How to change all avatar materials to glass?

1 messages · Page 1 of 1 (latest)

novel heath
#

Hello! I'm trying to create a system where, if a player activates a tool, all parts of their body and all accessories will be turned to white glass with a transparency of 0.3, reflectance of 1.0, and will linger for 30 seconds. However, I cannot find a single thing online documenting how to properly apply this, and I'm also fairly certain that it isn't possible to give accessories the glass texture. My current script seems to just apply transparency, and doesn't actually use the Enum.Material.Glass texture for accessories. Please let me know if it's possible to get this working, and I will paste my current "working" script in a separate message.

regal ore
#

im fairly certain the closest thing you will get to this is if you change the handle that is child to each accessory as you can change the material on that but not the actual accessory object which is parent to the handle.

#

each accessory should have a handle

#

if you change your code to just run through each accessory on the character and then find the handle that is child to it, you should be able to do it.

#

but all accessories do not look the same so the effect might not even really change anything on some accessories.

novel heath
#

Alright, I'll see if that gets it working. Thank you for your time :]

regal ore
#

@novel heath in a nutshell it would be something like this

for i, v in pairs(Character:GetChildren()) do
if v:IsA("Accessory") and v:FindFirstChild("Handle") then

    local accessoryHandle = v:FindFirstChild("Handle")

    accessoryHandle.Material = Enum.Material.Glass


        accessoryHandle.Color = Color3.fromRGB(255, 255, 255)
    accessoryHandle.Reflectance = 1.0

end

end

#

lmk if it works

novel heath
#

That's pretty similar to what I'm already doing, but I think I figured out my issue. I'm fairly certain that there's an engine limitation preventing handles from working the same as actual glass. Anything functioning under them can really only adopt the texture, but won't be able to refract the same as the body parts would. I could very well be wrong, but this is what it's looking like so far.

regal ore
#

yeah im not sure you cant really change that much with accessories.

#

the only thing you can really interact with is the handle

#

unless you want to change the accessory.

novel heath
#

ehh, I'm not terribly experienced, so I'll probably just keep what I have for now until I understand this better.

#

Thank you for your help, though :]

regal ore
#

np