-
What do you want to achieve? Keep it simple and clear!
I’m trying to do fly script with 2 anims, one is movement second is idle -
What is the issue? Include screenshots / videos if possible!
Code not founding AfkAnimation even if it exists in table and just override afk anim and restarts it - What solutions have you tried so far? Did you look for solutions on the Developer Hub? this is some issue with table ig
Code:
UIS.InputBegan:Connect(function(input, gameProcessed)
while UIS:IsKeyDown(Enum.KeyCode.W) and Char.Configs.CanFly.Value == true do
for _,anim in pairs(Char.Humanoid:GetPlayingAnimationTracks()) do
if anim.Name == "FlyAfkAnim"then
anim:Stop()
end
end
LoadedFlyAnimation:Play()
rs.Stepped:Wait()
bp.Position = root.Position +((root.Position - camera.CFrame.p).unit * speed)
bg.CFrame = CFrame.new(camera.CFrame.p, root.Position)
end
local anims = Char.Humanoid:GetPlayingAnimationTracks()
if not table.find(anims, "FlyAfkAnim") then --here it don't found anim even if it exists
print("not found")
print(anims)
LoadedAfkAnimation:Play()
end
end)