Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by lowbloodsugar · Mar 15, 2010 at 06:45 AM · textureiphonetexture2dmovietexturegif

Animated GIF as a texture on Iphone

Is there a way of playing animated GIFs through iPhone Unity?

Converting to a movie as an intermediate format wouldn't be an option unless it could be done on the fly.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by Eric5h5 · Mar 15, 2010 at 02:33 PM

Aisde from tiling the animation to one texture, you can cycle through individual texture frames:

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

On the more complex end of the spectrum, you can script an animated .gif parser and use actual animated .gif files. For smaller sizes the speed would probably be acceptable.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cregox · Nov 25, 2011 at 03:56 PM 0
Share

Don't know which script is faster / more efficient: Eric's or Joachim's (and here's an Extended version).

avatar image kidrockkenny · Feb 01, 2012 at 09:31 PM 0
Share

how come everytime i copy and paste someones script from here i get errors and cant play i did nothing to your script and it wont play im starting to get frustrated nothing seems to work for me

avatar image cregox · Feb 02, 2012 at 12:58 PM 1
Share

@kidrockkenny I'll try to tell this in the (least) sweetest way possible: you're doing it wrong. Now get back to your homework!!

avatar image
1

Answer by Jaap Kreijkamp · Mar 15, 2010 at 07:29 AM

Short answer: no. Long answer, you can't play animated gifs, you can play movie textures on iPhone either. So depending on the size of the animation, you'll need to tile the animation to one texture and animate the tiles. Although it's meant for Second Life, it should work for Unity as well: link.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image almo · Nov 20, 2014 at 09:21 PM 0
Share

"you can play movie textures" I think you need to edit that...

avatar image
0

Answer by GODLIKE · Jun 07, 2010 at 10:48 PM

There is a neat little script in the Unity Wiki that allows to "play" a series of textures without having to put them in a single one. You can also specify how many frames... very clean and effective. BUT you must convert your gif to a Unity readable format.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MightyMatty · Nov 11, 2011 at 02:41 AM 0
Share

Is there a link with this information in a tutorial please dude?

avatar image cregox · Nov 25, 2011 at 03:51 PM 1
Share

That's the script Eric already quoted, made by himself: http://www.unifycommunity.com/wiki/index.php?title=Texture_swap_animator

avatar image almo · Nov 20, 2014 at 09:22 PM 0
Share

This is why we don't like off-site links to code on StackOverflow. unifycommunity.com is domain-parked now.

avatar image cregox · Nov 24, 2014 at 02:57 PM 0
Share

@almo I'm willing to bet you are talking about mean my comment there. It has nothing to do with stackoverflow and it was actually acquired by Unity. No idea why they didn't kept the link references, though. Should have been simple enough. Anyway, you can just search for the title on the "new" wiki: http://wiki.unity3d.com/index.php/Texture_swap_animator - Also, Eric have already posted it in his answer, as I've tried to say.

avatar image Eric5h5 · Nov 26, 2014 at 03:44 AM 0
Share

@Cawas: I did ask them about it, and they agreed it was a problem, but in the end nothing happened. $$anonymous$$aybe whoever owns unifycommunity.com asked for too much money. I consider links to the forums and the wiki to be acceptable in answers here since they're all owned by Unity...if they go away, you can be pretty sure Answers is gone too.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Question on incorrect checksum for freed object 0 Answers

Get a portion of a Texture2D to another Texture2D 1 Answer

How to not see white background on texture 1 Answer

My Dynamic texture not showing up in the Build??? 0 Answers

Transparent gaseous/foggy sphere 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges