Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I have an error and I don't know what it means, how do I fix it?

All I did is

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()


mouse.Button1Down:connect(function()
                  while not player.Character do wait() end
	local character = player.Character
	local animateScript = character.Animate
 
                  local animController = Instance.new("AnimationController")
                  local animTrack = animController:LoadAnimation(AnimationObj)
                  animTrack:Play()
                   


	-- Create instance for new animation
	local newFallingAnimation = Instance.new("Animation")
	newFallingAnimation.Name = "FallAnim2"
	newFallingAnimation.AnimationId = 'https://web.roblox.com/item.aspx?id=540306344'
	newFallingAnimation.Parent = animateScript.idle
                  
                  -- Give new animation a Weight
	local newFallingWeight = Instance.new("NumberValue")
	newFallingWeight.Name = "Weight"
	newFallingWeight.Value = 1
	newFallingWeight.Parent = newFallingAnimation
 
	-- Give old animation a Weight as well
	local oldFallingWeight = Instance.new("NumberValue")
	oldFallingWeight.Name = "Weight"
	oldFallingWeight.Value = 4
	oldFallingWeight.Parent = animateScript.idle.FallAnim2

end)

and this error keeps popping up and I don't know what it means

LoadAnimation requires an Animation Object

3 comments

0

You attempt to load the variable 'AnimationObj' as an animation, but you never define AnimationObj.

0

AnimationObj is nil on line 11 there.

0

ok

1 answer

You forgot to define AnimationObj. Which means that AnimationObj = nil.

This discussion is preserved as it was. New answers, comments, and votes are closed.