Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I use animations on objects in game?

Asked by 7 years ago
Edited 7 years ago

This is a problem for me because it's not in a tool and it's not a player character it's a model but when I try to use it in game it just stops working. I don't really know why I can't figure it out but any help will be useful.

01local controller = Instance.new("AnimationController")
02controller.Parent = script.Parent
03 
04local fire = controller:LoadAnimation(script.Parent.Fire)
05local idle = controller:LoadAnimation(script.Parent.Idle)
06 
07idle.Looped = true
08fire.Looped = false
09 
10while true do
11fire:Play()
12idle:Play()
13wait(0.3)
14end

That was just a script I made out of my head but i'm still sure this won't work either way.

Please my weapon is in a model and I welded it to the camera no tools needed but in studio it works but not in game.

0
Details please: is this in a Script or a LocalScript? It should be in a Script. Does your model have a HumanoidRootPart? Overscores 381 — 7y
0
Is there an error in the output? TickTockTheory 106 — 7y
0
No there is not error and its in a normal script and it does have a humanoidrootpart thing is i cloned the model from replicated storage and none of the scripts are running in the cloned one GameBoyOtaku 63 — 7y

Answer this question