AK47xM16
(AK47xM16)
August 31, 2020, 6:46pm
#1
Here’s what the problem looks like: https://gyazo.com/58e8848aa29c42e6ac1814664eb25a53
Here’s where the animations are preloaded and stored for use: https://gyazo.com/5ef6221bf8de33b8df0eec31c7290c4f
I load the animation to play by a server script inside the character:
local barrage = animControl:LoadAnimation(game.ReplicatedFirst.Preloader.EchoesA3:WaitForChild("Barrage"))
Inorder to stop the animation, I put the animation’s weight to 0.00001, like so:
barrage:AdjustWeight(0.00001)
1 Like
You can use animation:Stop() in order to stop an animation. You should likely do that instead of setting the weight to 0.00001.
AK47xM16
(AK47xM16)
August 31, 2020, 6:49pm
#3
Yeah, but the problem is that it does this when I do :Stop()
https://gyazo.com/9cca057bc638b81a9b96e4793db8037e
My bad, then. Might I see your code?
AK47xM16
(AK47xM16)
August 31, 2020, 6:51pm
#5
Solved. Solved. Solved. Solved. Solved.Solved.
Interesting. Calling :Stop() on the animation shouldn’t cause that to happen… are you using :Stop() in conjunction with :AdjustWeight()?
AK47xM16
(AK47xM16)
August 31, 2020, 6:56pm
#7
I’m using :Stop() as a replacement for now, until I can fix this problem. If I call stop, the animation still plays even after the barrage is done.
I’m sorry if I can’t help you, I haven’t used AnimationController’s nor animation instances. I’ll try my best, though.
Nube762
(Nube762)
August 31, 2020, 7:00pm
#9
I think it is because you are creating a track anim each time the remote event is fired
AK47xM16
(AK47xM16)
August 31, 2020, 7:01pm
#10
No, I preload the animations from the preloader.
dreadbytes
(dreadbytes)
August 31, 2020, 7:27pm
#11
Every time you call Humanoid:LoadAnimation(AnimationObject)
, it creates a new AnimationTrack object, whether or not you have preloaded it previously.
It does not use some kind of cached animation track, rather it creates a new one.
You can test this by doing Humanoid:LoadAnimation(AnimationObject) == Humanoid:LoadAnimation(AnimationObject)
, which should return false.
To fix this, my solution would be to reference the AnimationTrack somewhere when the action starts, and getting the AnimationTrack once the action ends, and calling :Stop()
on it.
3 Likes
AK47xM16
(AK47xM16)
August 31, 2020, 8:31pm
#12
I tried referencing the animation control at the top, and it worked.