Animation clip created with script is empty
And so, I will try to briefly describe the problem.
Based on answer to this topic, I wrote the logic that creates animation from png files.
The problem is that when switching to Play Mode, Unity removes all sprites from the animation, making it (animation) empty. Any ideas what this is related to?
Answer by tonaros1 · Sep 22, 2021 at 12:35 PM
I solved the problem.
Instead of pulling sprites from the system file, I took them from RAM, as a result of which there were no references for the animation to work.
Paste the code in case someone has the same problem.
foreach (var file in files) {
sprites.Add(AssetDatabase.LoadAssetAtPath<Sprite>(file));
}
Your answer

Follow this Question
Related Questions
Why does my Character jump out its collider box when it plays animation clip? 1 Answer
How can I make 2 or more sprite lines on the same Animation clip (2D Animation) 0 Answers
Character animation restarts every frame 0 Answers
Why is editing any Animation Clip keyframe resetting all my curves? 0 Answers
Create Animation Clip from Sprites[] (Programmatically) 3 Answers