Play dummy animation by a changing block color

Hello,

Im making a roller coaster, but i have a problem…

At one point, a block is changing his color… But at that point it also needs to play a dummy animation. But i dont know how i can do that.

Ive tried to do it with (wait) but that doesnt work out…

Can someone help me please?
Thanks

You can do an if statement that listens when the color is changed, then do humanoid:LoadAnimation()

1 Like

Thanks, im going to check and test it!

It’s better to use the Animator object instead, and call LoadAnimation() from there

OP though, if it’s just a BasePart we’re talking about here I believe you can just do something like BrickColor.random so that way we don’t have to workaround using something like:

local RanColor = Color3.FromRGB(math.random(1, 255), math.random(1, 255), math.random(1, 255))

Cause that’s not fun to deal with

I can give you an example of a possible idea that could work:

local Dummy = workspace:WaitForChild("Dummy")
local Hum = Dummy:WaitForChild("Humanoid")
local Animator = Hum:WaitForChild("Animator")
local AnimationObject = nil -- You're gonna have to change this with your Animation Object, cause "nil" in this example is just a placeholder

local Block = workspace:WaitForChild("Block") -- Replace that with what part you want to change color with

local function ChangeColor()
    Block.BrickColor = BrickColor.random()

    local Anim = Animator:LoadAnimation(AnimationObject)
    Anim:Play()
end

ChangeColor() -- We want to call this so that the function plays its actions
1 Like

Thanks, im going to experiment with it!