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

How would I make an animated texture/decal?

Asked by 3 years ago

I'm making an obby and when I make conveyors I would like to put an arrow texture/decal on it which moves in the direction of the conveyor, similar to "THE IMPOSSIBLE OBBY". Would I need to script that or do it manually, and whichever way I need to use, can I get a walkthrough on how to do so. I'm comparatively new to Studio, so sorry if it has a very simple explanation.

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Hello,

In your case, you would want to use an Array Table in order to animate your texture/decal. Something you do require is to have different decals that make up the animation. To use an array table you can simply put a loop on the textures/decals so they will animate without putting too much pressure on the server.

Here is how you would use an Array Table for the animation:

local Conveyor = workspace.Conveyor -- Change this to the path of your conveyor
local ConveyorContent = Conveyor.AnimatedDecal -- Change AnimatedDecal to the decal / texture name you would like to animate

local TextureAssetIDS = {
  000000000, -- Change the 000000000 with the decal / texture id, if you want more make sure to add a comma next to the last current number and once you get to the final number make sure it has no comma.
  000000000
}

local function AnimatedFrames(Frames)
    for _,frame in pairs(Frames) do
        ConveyorContent.Texture = "rbxassetid://"..frame
        wait(.1)
    end
end

while true do AnimatedFrames(TextureAssetIDS) end

I hope this has helped you!

0
So where would I put this code in exactly? Should insert it into the decal? And to have two different decals animating would I have to make the same decal twice and then move it so that one decal changes o the next? Sorry but I can't seem to wrap my head around this concept. Thank yo for the answer though! NightWarrior1717 14 — 3y
0
Good question. You can put the script in ServerScriptService! Also, yes, to have an animated decal you need to upload multiple version of the decal so it completes the animation, multiple frames. All you require is to paste the decal ids to the 0's in the script and the script will do the animating RazzyPlayz 497 — 3y
Ad

Answer this question