Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add .gif Animation in unity Scene ? Does Unity support Animated GIFS?

I am working on Unity + Augmented reality. I want to show some "animated .gif" file on specific location on Marker detection event. I manage all but, I wanna display .gif animation at specific location on Android screen. But I think

Unity does not support .gif

and

Android does not support VideoTexture.

like image 262
Sanket Prabhu Avatar asked May 10 '16 10:05

Sanket Prabhu


1 Answers

Unity not support Gif.

You have 2 options:

  1. Split animation and use Animator: there you have a nice howto
  2. Save individual frames and make an array of textures.

    var frames : Texture[]; var framesPerSecond = 10;

    function Update() { var index : int = (Time.time * framesPerSecond) % frames.Length; renderer.material.mainTexture = frames[index]; }

like image 105
joreldraw Avatar answered Sep 18 '22 03:09

joreldraw