Skip to content

Instantly share code, notes, and snippets.

@spotco
Created January 12, 2017 08:23
Show Gist options
  • Select an option

  • Save spotco/d5bc636ffd4ac54f03735d2354d81c23 to your computer and use it in GitHub Desktop.

Select an option

Save spotco/d5bc636ffd4ac54f03735d2354d81c23 to your computer and use it in GitHub Desktop.
apply_mesh_texture_recursive.lua
function recurse(itr)
for _,child in pairs(itr:GetChildren()) do
if child.Name == "TestBuilding1" then
child.Building1Mesh.TextureID = "rbxgameasset://Images/building1_diffuse"
end
if child.Name == "TestBuilding2" then
child.Building2Mesh.TextureID = "rbxgameasset://Images/building1_diffuse"
end
if child.Name == "TestBuilding3" then
child.Building3Mesh.TextureID = "rbxgameasset://Images/building3_diffuse"
end
recurse(child)
end
end
recurse(game.Workspace.Environment.BackgroundBuilding)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment