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

Why cant I play my animation?

local Player = game.Players.LocalPlayer 
local Mouse = Player:GetMouse()
Mouse.KeyDown:connect(function(key)
if key == "x" then
	
local Test = Instance.new("Animation")
	Test.AnimationId = "http://www.roblox.com/Asset?ID=276753163"
local animController = BikakuModel2.AnimationController
animController.Parent = BikakuModel2

local animTrack = animController:LoadAnimation(Test)
animTrack:Play()

I'm trying to play an animation in my model however it doesn't work despite the fact that I believe I've set up my model with Motor6D Parts correctly along with an AnimationController as seen in the code above.

1 answer

local Player = game.Players.LocalPlayer 
local Mouse = Player:GetMouse()
Mouse.KeyDown:connect(function(key)
if key == "x" then

local Test = Instance.new("Animation")
    Test.AnimationId = "http://www.roblox.com/Asset?ID=276753163"
local animController = BikakuModel2.AnimationController
animController.Parent = BikakuModel2

local animTrack = animController:LoadAnimation(game.StarterPack.Test) -- You didn't tell the script where the animation was (I'm new at scripting)
animTrack:Play()

2 comments

0

I fixed it myself but I'll upvote anyway.

0

So was I correct?

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