Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by Nareice J Wint · Jan 14, 2013 at 06:05 PM · imagemovietexturegif

Image Sequence in unity without using .gifs for a crowd

Hey there, I'm making a racing game for my University project. Everything is going well, but i heard you can't input gifs into Unity? I want to make one of those old crowd simulations. For example :https://www.youtube.com/watch?v=cCFBwxn92Bc

You can see the back rows are around 5 images put together. I already have the images done, but is there a way to put it in my game? Any starting help would be appreciated, thank you :)

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Augusto Cesar · Jan 14, 2013 at 07:57 PM

Hi, you could simply put these images together in an "atlas" like texture, and scroll your UVs, so if you put the image on a plane, and scroll your texture, you will get the same behavior of a gif.

this is the basic concept, if you need more directions, just tell me, i have made this for a project, and i could give you more directions if you need.

Comment
Add comment · 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
0

Answer by Sir-Gatlin · Jan 18, 2013 at 08:09 PM

Hey Augusto, Im trying to pretty much make a gif object in unity on a plane, Iv tried using the Textureswapanimator.js found in the wiki but for some reason it wont advance past the first frame. So I was wondering if you could elaborate on your UV concept, being new to unity im guessing you somehow apply multiple textures to an object and somehow write a code that will just switch between them quickly?

 var frames : Texture2D[];
 var framesPerSecond = 10.0;
 
 function Update () {
     var index : int = Time.time * framesPerSecond;
         index = index % frames.Length;
             renderer.material.mainTexture = frames[index];
 }
Comment
Add comment · Show 2 · 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 Augusto Cesar · Jan 18, 2013 at 08:37 PM 0
Share

Sir Gatlin ,

Your code actually works, i think that you are missing assigning the textures into the "frames" array. Put at least 2 imgs, and they will cycle based on the "framesPerSecond" variable.

This example code you posted works,but i have developed another method, that changes the uvs of the texture, and then creates the same effect.

Test if you have assigned all correctly, and post if it works for you, if not i will help you to create this effect based on Uvs.

avatar image Sir-Gatlin · Jan 18, 2013 at 10:07 PM 0
Share

Huh, Interesting enough I started a whole new project and did a test with this code and it worked fine... I had some 3rd party assets and plug ins and was having some bugs with one of them earlier in the project so maybe something was conflicting. thanks for the quick response and helping me trouble shoot this problem.

Truly Appreciated, G

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

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Animated GIF and Audio Instead of Video? 3 Answers

WbPlayer Loading From File 0 Answers

Image Effects on MovieTexture 0 Answers

Animated GIF as a texture on Iphone 3 Answers

Noob trying to figure out Depth of Field, documentation (edited) 1 Answer


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