|
| 05 Apr 2017 08:00 PM |
How to turn a whole model transparent without single handedly changing each part transparent?
|
|
|
| Report Abuse |
|
|
| |
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 05 Apr 2017 08:05 PM |
model = workspace.SomeModel for _,part in next,model:GetChildren() do if part:IsA("BasePart") then part.Transparency = .5 end end |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2017 08:06 PM |
local function forAll( parent, func ) for _, child in ipairs( parent:getChildren() ) do func( child ) forAll( child ) end end
forAll( model, function( child ) if child:IsA( "BasePart" ) then child.Transparency = whatever end end) |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2017 08:07 PM |
local function forAll( parent, func ) for _, child in ipairs( parent:getChildren() ) do func( child ) forAll( child, func ) end end
my bad forgot to keep functions |
|
|
| Report Abuse |
|
|
| |
|
ydog45
|
  |
| Joined: 05 Dec 2015 |
| Total Posts: 79 |
|
|
| 05 Apr 2017 08:08 PM |
| This is easy just use your mouse and click and drag on all of the parts and then make it transparent |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 05 Apr 2017 08:08 PM |
local function SetTrans(model,set) for _,v in next,model do SetTrans(v,set) if v:IsA("BasePart") then v.Transparency = set end end end
SetTrans(YourModelGoesHere,0.5)
|
|
|
| Report Abuse |
|
|
|
| 05 Apr 2017 08:10 PM |
| To be more specific, Im asking how to make all objects in a model transparent when a player touches a part through code. |
|
|
| Report Abuse |
|
|
| |
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 06 Apr 2017 10:44 AM |
local function SetTrans(model,set) for _,v in next,model do SetTrans(v,set) if v:IsA("BasePart") then v.Transparency = set end end end
script.Parent.Touched:connect(SetTrans(YourModelGoesHere,0.5))
|
|
|
| Report Abuse |
|
|