You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to do AnimationTrack.Looped = false
What is the issue? Include screenshots / videos if possible!
No issue, just wondering if there’s better solution , because roblox is kinda weird when it comes to animations!
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried to wait for animationTrack.Length
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
function WaitUntilAnimationIsLoaded(animation)
repeat wait() until animation.Length>0
return true
end
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
Ok, I definetly didn’t remember at all.
The code you presented is perfectly fine then, I wouldn’t worry about trying to change what you have because if it is not inducing any performance drops, and works as intended, what is there to change? Don’t fix whats not broken.
Basically, it’s very slow at loading so I wanted to ask if there’s Event inside AnimationTrack that detects if the animation is loaded, because I feel like its necessary, because if you call AnimationTrack.Looped = false, before animation is loaded using .Length >0 it will loop it forever.
After a little bit of googling, I found something called Animation:IsLoaded() which should return a bool value.
Looping an if statement should return a true response once the animation is loaded and from there you can call the AnimationTrack.Looped = false
After this i’m out of ideas DX
Funny,
I am not overcomplicating it, I am just hinting out that roblox scripting is sometimes horrible for no reason.
function WaitUntilAnimationIsLoaded(animation)
repeat wait() until animation.Length>0
return true
end
local animation : AnimationTrack = Animator:LoadAnimation(Animation)
animation.Looped=false -- this won't turn the animation.Looped to false test by using
print(animation.Looped) -- This will print true if animation is looped by animator.
WaitUntilAnimationIsLoaded(animation) -- This function waits until animation has Length
animation.Looped=false -- Finally we can turn animation Looped to false
print(animation.Looped) -- This finally prints false
Another complicated situation
local Part = Instance.new("Part",workspace)
Part:SetNetworkOwner(player) -- Makes the Network Owner to the Player
instance.new("Part",Part) -- Part gets new Part inserted
Part:GetNetworkOwner() -- Somehow Network owner is now Server```