Waum_a
(Waum_a)
September 16, 2020, 11:03pm
#1
Hello Developers! I’m trying to do run a script to run an animation, but for an unknown reason is not working, and I have no errors on the output.
What do you want to achieve? Keep it simple and clear!
I want to do run a script then it runs an animation of the NPC.
What is the issue? Include screenshots / videos if possible!
The animation is not working on the NPC, and I have no errors on the output.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried searching in youtube, but it didn’t help.
I want to do an animation run in a NPC, I’m using a script but is not working, and I have no errors on the output.
I hope you can help me.
Kindest regards,
Waum_a.
print "Loading animation...."
wait (5)
local Animation = script.Parent.Animation1
local aim = script.Parent.AnimationController:LoadAnimation(script.Parent.Animation1)
aim:Play()
print "Sucefully loaded animation."
2 Likes
WooleyWool
(AWildWooleyWool)
September 17, 2020, 12:45am
#2
Is this animation part of Roblox? Is it a custom animation that you are playing?
print ("Loading animation.... "
wait(5)
local Animation = script.Parent.Animation1
local humanoid = -- You have to get the Humanoid of NPC You're trying to Play the Animation On
local AnimationTrack = humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
print("Successfully loaded animation.")
5 Likes
Waum_a
(Waum_a)
September 17, 2020, 2:53pm
#4
I uploaded it to roblox. Is mine.
1 Like
WooleyWool
(AWildWooleyWool)
September 17, 2020, 2:54pm
#5
Did you put the correct animation ID?
2 Likes
Waum_a
(Waum_a)
September 17, 2020, 2:59pm
#7
Yes, I put the correct animation ID.
Waum_a
(Waum_a)
September 17, 2020, 3:07pm
#8
print ("Loading animation.... ")
wait(5)
local Animation = script.Parent.Animation1
local humanoid = script.Parent.Humanoid
local AnimationTrack = humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
print("Successfully loaded animation.")
Now I have no errors on the output but is not working.
Could you show me a picture of the contents of the NPC ?
We can even rearrange the script
local Animation = script.Parent.Animation1
local humanoid = script.Parent:WaitForChild("Humanoid")
local AnimationTrack = humanoid:LoadAnimation(Animation)
print("Loading Animation... ")
wait(5)
AnimationTrack:Play()
print("Successfully loaded animation.")
1 Like
alphajpeg
(iris)
September 17, 2020, 4:17pm
#10
local AnimationId = 0 --Put your animation id here.
local NPC = script.Parent --I put parent as the example.
local Humanoid = NPC:WaitForChild("Humanoid")
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid//"..AnimationId
local Track = Humanoid:LoadAnimation(Animation)
Track:Play()
print("Successfully ran animation.")
2 Likes
Waum_a
(Waum_a)
September 17, 2020, 4:30pm
#11
, “Animations” script is the script to run the animation.
Waum_a
(Waum_a)
September 17, 2020, 4:33pm
#12
Also the animation is mine, and is off-sale. That can be a problem?
WooleyWool
(AWildWooleyWool)
September 17, 2020, 4:45pm
#13
The sale doesn’t affect anything. It’s whether or not you did the code right
2 Likes
Waum_a
(Waum_a)
September 17, 2020, 7:40pm
#14
I used Moon Animator, maybe that is the problem?
Waum_a
(Waum_a)
September 17, 2020, 7:42pm
#15
Still not working. I sent you the picture of the contents of the NPC.
Did you try 50Alpha’s Solution ?
Try This
while true do
wait(5)
AnimationTrack:Play()
end
1 Like
Waum_a
(Waum_a)
September 17, 2020, 11:49pm
#18
Of course! I did! I tested it but it didnt worked.
Waum_a
(Waum_a)
September 17, 2020, 11:50pm
#19
Is not working it seems there is a big problem.
Waum_a
(Waum_a)
September 17, 2020, 11:51pm
#20
The “Success” doesn’t print. I don’t know why.