Is it possible to change SurfaceAppearance properties with a script?

Hi,

I am trying to use a script to change leaf properties based on a Season, but I am wondering if this is possible, as the trees/leaves that I am working with are using SurfaceAppearance. I am wondering if it is necessary for me to switch to TextureID in order for this to work.

Here is an example of my code:

local season = game.ReplicatedStorage.Season.Value
local leafcolor = script.Parent.SurfaceAppearance.ColorMap

while wait(1) do
   if season = "fall" then 
    leafcolor = "rbxassetid://7935993145"
  end
end

Am I doing something wrong? Is this not possible right now?

2 Likes

You can’t change any of the textures on surface appearances. The closest you could get would be parenting and unparenting a bunch of premade surface appearances.

5 Likes

None of the properties of SurfaceAppearance instances are scriptable, they can only be modified manually from the properties window or through the use of the command bar while in studio.

1 Like

That’s what I’ve decided to do for now, thanks for the help!