#Animation flickering when i play it.

1 messages · Page 1 of 1 (latest)

potent needle
#
  1. Increase the animation priority
  2. AnimationTrack:Stop() all the track before playing a new one (NOT SURE IF THIS WORKS, BETTER OFF JUST USE THE FIRST METHOD)
magic bobcat
#

idle or walk

potent needle
#

walk ofc

magic bobcat
#

k

#

ok i did it but its still doing that wierd thing

potent needle
#

r u sure the idle anim is looped

#

if yes then uh

magic bobcat
#

i am using the default idle animation

potent needle
#

do the 2nd method

magic bobcat
#

ok

potent needle
#

tbh if you are only going to replace 1 animation then it is better off just copy the animate script from the player.Character itself

#

because high chance you are having 2 running animations playing at the same time

magic bobcat
potent needle
#

can you record a longer vid of you walking

magic bobcat
#

i can but i cant sent it in discord

potent needle
#

i think you still should use the default Animate script cuz it is well optimized

magic bobcat
potent needle
#

which?

magic bobcat
#

default animator script

potent needle
#

it is pretty ok for me

#

even have anim transition time and such

#

let me try this script in my game

magic bobcat
#

ok i fixed it, this is what we needed

local Humanoid: Humanoid = script.Parent:FindFirstChild("Humanoid")
if not Humanoid then
warn("Humanoid not found!")
return
end

local Animator: Animator = Humanoid:FindFirstChild("Animator")
if not Animator then
warn("Animator not found!")
return
end

local animationTracks: {[string]: AnimationTrack} = {}
local currentAnimationTrack: AnimationTrack = nil

for _, child in script:GetChildren() do
if child:IsA("Animation") then
local animationTrack = Animator:LoadAnimation(child)
if animationTrack then
animationTracks[child.Name] = animationTrack
end
end
end

animationTracks["Idle"]:Play()

function playAnimation(animationName: string)
local animation = animationTracks[animationName]
if animation and animation ~= currentAnimationTrack then
if currentAnimationTrack then
currentAnimationTrack:Stop()
end
currentAnimationTrack = animation
animation:Play()
end
end

Humanoid.Running:Connect(function(speed: number)
if speed > 0.01 then
playAnimation("Walk")
else
playAnimation("Idle")
end
end)