#Animation flickering when i play it.
1 messages · Page 1 of 1 (latest)
increase the priority of which animation
idle or walk
walk ofc
i am using the default idle animation
do the 2nd method
ok
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
i have 1 running script, i deleted the default one
can you record a longer vid of you walking
i can but i cant sent it in discord
i think you still should use the default Animate script cuz it is well optimized
the code written is not good at all
which?
default animator script
it is pretty ok for me
even have anim transition time and such
let me try this script in my game
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)