-
I have a battle system that is supposed to work on regular R6 characters without any edits to the original characters, and it works, however, changing animations from custom to regular is jittery and functions strange.
The plan was that it changes animation id’s in the character animate script and the animate script handles it, however, it didn’t work as expected, and instead I have to do an inefficient check of animations playing, seeing if the playing animation is walking, and play the custom animation over the regular walking one (so essentially blending animations with a hacky workaround). -
The issue is that the method above doesn’t work perfectly, because it plays an intense running animation that’s easy to tell apart from the regular one and it makes you run in place at times, because the script thinks you’re walking (but it’s just the regular walking animation that’s carrying over, even though you came to a stop), and same thing happens when switching back to the regular animations.
Is there a more effective way of doing this without rewriting the whole animate script? Or an alternative to the workaround I made?
Scripts:
function BattleAnimationsEquip()
local anim = Character:FindFirstChild("Animate")
if not anim then return end
anim.walk.WalkAnim.AnimationId = "rbxassetid://4477869471"
local an = Humanoid:LoadAnimation(anim.walk.WalkAnim)
---------------------------------- make sure that other animations stop playing, because apparently it doesn't overwrite.
local playinganims = Humanoid:GetPlayingAnimationTracks()
for i,track in pairs(playinganims) do
if track.Name == "WalkAnim" then
track:Stop() --- stop the regular walking anim,
an:Play() --- play the custom one.
end
end
----------------------------------
anim.idle.Animation1.AnimationId = "rbxassetid://4477867869"
anim.idle.Animation2.AnimationId = "rbxassetid://4477867869"
anim.jump.JumpAnim.AnimationId = "rbxassetid://4477870746"
Character.Humanoid.WalkSpeed = 23
Character.Humanoid.JumpPower = 55
end
Switching back functions the same way, just the animation ID’s are different.