Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you adjust the transparency of a Model?

Asked by
Mydos 5
9 years ago

I have this model in my game of a conveyor belt that I am trying to make invisible on one condition and visible on another. Also, I'm trying to make it not collide. However, when I try to use the following code:

conveyor.Transparency = 1
conveyor.canCollide = false

It says "Transparency is not a valid member of Model." Can anyone help figure out how to do it properly?

0
I recommend setting its parent to nil instead. 1waffle1 2908 — 9y

1 answer

Log in to vote
0
Answered by
NotSoNorm 777 Moderation Voter
9 years ago

You're simply trying to adjust the model itself, not it's parts inside. You have to go inside of the model and edit each one of these parts separately(A little annoying, I know)

We'd use a loop so it's nice and easy.

for i,v in pairs (conveyor:GetChildren()) do --Create loop to iterate through all parts inside the model
    v.Transparency = 1 -- v refers to the current part we're addressing in the model
    v.CanCollide = false
end
0
This will get an error if an object doesn't have a Transparency property. GShocked 150 — 9y
Ad

Answer this question