generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Help With Turning A Whole Model Transparent

Previous Thread :: Next Thread 
baconmystomach is not online. baconmystomach
Joined: 05 May 2013
Total Posts: 188
05 Apr 2017 08:00 PM
How to turn a whole model transparent without single handedly changing each part transparent?
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
05 Apr 2017 08:02 PM
cant do that
Report Abuse
Soybeen is not online. 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
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
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
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
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
baconmystomach is not online. baconmystomach
Joined: 05 May 2013
Total Posts: 188
05 Apr 2017 08:07 PM
sweeet
Report Abuse
ydog45 is not online. 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 is not online. 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
baconmystomach is not online. baconmystomach
Joined: 05 May 2013
Total Posts: 188
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
baconmystomach is not online. baconmystomach
Joined: 05 May 2013
Total Posts: 188
05 Apr 2017 08:10 PM
^^ Above @ydog
Report Abuse
Soybeen is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image