animations doesn't start

Viewed 39

I've been trying to make the dummy animate whenever it's walking or it's still. The problem is that the animations doesn't start. code

local Customer = script.Parent
local idle = Customer.Humanoid:LoadAnimation(script.Parent.Idle)
local Walk = Customer.Humanoid:LoadAnimation(script.Parent.Walk)
local Speed = Vector3.new(Customer.HumanoidRootPart.Velocity.X, 0, Customer.HumanoidRootPart.Velocity.Z).magnitude
if Speed > 1 then
    if idle.IsPlaying then
        idle:Stop()
    end
    Walk:Play()
end

if Speed == 0 then
    if Walk .IsPlaying then
        Walk:Stop()
    end
    idle:Play()
end

I've tried searching around but I didn't understand, or found anything helpfull I'm new into coding, so i don't really know these type of stuff

I've tried writing the animation in another way too, but it gives me an error

local idle = Customer.Humanoid.Animator:LoadAnimation(script.Parent.Idle)

Animator is not a valid member of Humanoid "Workspace.Models.Clients.Customer1.Humanoid"

1 Answers

I've run into this issue as well. The dummy rigs that you get from the Rig Builder plugin appear to be just the rigs, they don't come with any of the helpful bits for animating like the Animator or any of the scripts that handle the loading of the Scripts.

You might be able to get a working dummy from the Toolbox, but buyer beware. They might be infected with malicious scripts.

The best work-around I have found is to copy a working rig, then strip it down to the bare essentials, then swap out the values to load the correct animations.

So follow these steps:

  1. Simply play your game. Your character will spawn into the world, and that will be the rig you will be using.

  2. Go into the Explorer widget, and Ctrl+C copy your character model from the Workspace.

  3. Stop playing the game. This will bring you back to Edit Mode.

  4. Select the Workspace in the Explorer widget and Ctrl+V paste the copied character model. This will allow you to have a functional rig template.

  5. Clean up the rig.

  • Rename it to Dummy or something that will help you know what it is.
  • Delete the hats and other accessories that come with your character.
  • Reset the colors in the color appearance.
  • Update or remove the animationIds in the idle, walking, running, swimming, jumping, etc animation objects.

That should be enough to get a working dummy that you can use as your character template. Then you can test whether your code is failing for an actual reason and not just because you've got an empty rig.

Related