My RemoteFunction is finishing automatically and returning nil, and don’t wait the animation stop, the script is here:
local ATs = Animator:GetPlayingAnimationTracks()
local Animation
for _, v in pairs(ATs) do
if v.Animation.AnimationId == AnimationId then
Animation = v
end
end
Animation.Stopped:Connect(function()
return true
end)
end
This schedules a function to be run, it doesn’t wait for it; in other words, the thread continues and the supplied callback runs asynchronously. The way you did it would also cause a memory leak!