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
1
Question by Ophyzarr · Jun 01, 2013 at 03:53 PM · animationtexturegraphics

How do you create an animated texture for a UV'd Mesh and apply it?

Hello UnityAnswers! I've been searching around the internet for a potential solution to my problem for the past 6 hours now, and to no avail.

Here's the problem

The lamps

I've created a ceiling lamp model, and from that model I have 2 textures and 2 materials, one set used for an "On" lamp and the other set for an "Off" lamp based on their respective prefabs. (You can see my file structure here). These two lamps are working nicely so far, but there's something I'd like to do with the "On" lamp, which involves a very subtle animation. I decided that the way I was going to do this was by having separate images for the different frames of the animation, the ol' traditional way.

This is my problem in particular, there seems to be no obvious way of having a looping frame by frame texture animation for a 3D mesh so far that I can perceive in Unity. I do understand that there may be potential of having some code that runs the images in a for loop, or perhaps a Shader that can do the whole animation; except that there seems to be no clear or present step-by-step walkthrough on how to do so.

Long story short, how would I go about turning these:

The Frames

into this, but in 3D space inside Unity on a Mesh (warning, the animation is very subtle):

Animation

Comment
Add comment · Show 1
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 robertbu · Jun 01, 2013 at 04:49 PM 0
Share

http://wiki.unity3d.com/index.php?title=Animating_Tiled_texture

http://wiki.unity3d.com/index.php/Animating_Tiled_texture_-_Extended

The "best" way to do this would be to animate the mesh UV's (which is not what the above two scripts do). Third-party programs make this easier.

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Eric5h5 · Jun 01, 2013 at 05:33 PM

Ideally you would combine those textures into a single texture, then you can just change renderer.material.mainTextureOffset as appropriate. This would involve remapping the UVs of the model to accommodate the larger texture, but that only has to be done once.

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 Ophyzarr · Jun 01, 2013 at 09:07 PM 0
Share

Thank you very much! I now have a light with a nice glow after tweaking around and making a texture atlas. Very pleased with the result

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

15 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

How to distort background images? 0 Answers

How to change textures over time? 0 Answers

reset 2d animation(sprite sheet texture) 0 Answers

How do I create my own character in Unity 3-D? 2 Answers

Specific texturing 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