I was wondering if it possible to use .gif files with some kind of script that decomposes the gif and loop thru the frames. Is this even possible?
I’m assuming you are using a 2D game if so just make a Sprite sheet.
Yes but, I only have .gif files. And its 150+ of them.
I’m using them via script with Resource.Load not manually adding them to the scene.
Thats why I’m looking for a way to use the .gif files if possible via script.
You’ll have to deal with it in an art package, or code a utility that reads .gif - unity doesn’t natively deal with it. Try asset store etc.
https://www.assetstore.unity3d.com/en/#!/content/38549 you could search next time ![]()
So, I bought that and convert all the gifs to png spritesheets + animation.
Now the sprite looks fine, but animation is doing nothing.
As I said both the sprite and the animation are loaded from Resources folder.
GameObject has SpriteRenderer and Animation components.
Both seem to have the right files attached on inspector when I hit play (Animation has the Animation on the Animations List and on debug mode it looks like its playing).
But it just shows the first sprite of the sheet, never animates.
I’m using Animation.AddClip and Resource.Load(“TheAnimation”, “TheAnimation”); (TheAnimation being the name of the Animation file created before). Then Animation.Play(“TheAnimation”);
(Animations have Legacy checked).