How do I have the "Animate" script work with my custom monster rig?

When I say custom rig I mean, like, a spider-flesh monster custom rig. Not a human thing. So yeah the animate script isn’t working too well. It only animates the parts of the rig that have the same names as the Roblox body parts (which is like two parts). How do I get this to work

1 Like

You have to make your own animations and then script them yourself. I.e. an animate script.

The following script should be a server script inside of StarterCharacterScripts for a player and inside the character for an npc.

local Hum = script.Parent:FindFirstChild("Humanoid")
--animation variables here

Hum.Running:Connect(function(speed)
    if speed > 0 then
        --Play animations here
    elseif speed == 0 then
        --Stop animations here
    end
end)
local Hum = script.Parent:FindFirstChild("Humanoid")

local walk = script.Parent.Humanoid.Animator:LoadAnimation(script.Parent.fleshMonsterWalk)
local idle = script.Parent.Humanoid.Animator:LoadAnimation(script.Parent.fleshMonsterIdle)

idle:Play()
Hum.Running:Connect(function(speed)
	if speed > 0 then
		walk:Play()
	elseif speed == 0 then
		walk:Stop()
	end
end)

problem 1: it doesn’t play the idle animation, it just goes straight to the walking animation (even though i dont have the thing move for 7 seconds)
problem 2 (could possibly be cause of problem 1): because my rigs legs are not cancollide false, they scrape against the ground and cause the rig to move in unwanted ways
how do i fix this?

nvm i got it:
i extended the hrp to the ground and made the legs cancollide false

is that a good solution
or will that have unforseen problems in the future

You would to my knowledge, have to make the legs can collide off.
Oh, and I forgot one thing, at walk:Stop(), after that you can put idle:Play(). And some more forgotten things;

local Hum = script.Parent:FindFirstChild("Humanoid")
local walk = Hum.Animator:LoadAnimation(script.Parent.fleshMonsterWalk)
local idle = Hum.Animator:LoadAnimation(script.Parent.fleshMonsterIdle)
local walkPlaying = false

idle:Play()
Hum.Running:Connect(function(speed)
	if speed > 0 and not walkPlaying then
                idle:Stop()
		walk:Play()
	elseif speed == 0 if walkPlaying then
		walk:Stop()
                idle:Play()
	end
end)

(if this doesn’t work it’s because I’m not on studio I’m just typing from memory)

well i actually have idle looped, so its basically always playing, just it will be overwritten by the walk animation temporarily since its “movement” and not “idle” in animation priorities

at least im pretty sure that would be how it works
right?

The animate script is compatible with R6 and R15 rig types only, you’re going to need to fork the animate script and change the names of the limbs it looks for.