Search Unity

Animated texture with several images

Discussion in 'Editor & General Support' started by MordazaH, Aug 27, 2016.

  1. MordazaH

    MordazaH

    Joined:
    Oct 15, 2015
    Posts:
    50
    Hi all,
    I have been trying to figure out the best way to achieve this and I have found some ways that work fine, but I would like to know if there is a better more automated way to do that. So my main scenario is that I have several images that make an animation (like explosion or fire), then I want to apply these to a quad one after another in a certain order and with some delay between them. My current experiments proved that it can be done with code changing the main texture from the object one after another, also I found that I can change the texture in an animation clip manually adding keyframes where texture is changed, but as said I dont know if there is a better way to do that, also I have some animations compound of +30 images so if there could be a more automated way it would be great (something like the way Flash does), I read a bit about sprites and how in these it can be created a succession of images specifying framerate and all but I dont think I can apply the sprite animation created to the quad mentioned, so any ideas will be welcome, thanks =).

    Edit: Im working in a 3D game, just in case it helps
     
    Last edited: Aug 27, 2016
  2. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    Atlas + texture offset in the material. You can animate it with an animation track, script or even a shader, depending on the requirements.
     
    MordazaH likes this.
  3. MordazaH

    MordazaH

    Joined:
    Oct 15, 2015
    Posts:
    50
    Thanks @zombiegorilla =), it seems it could work, well I have to try the program to generate the atlas image, I have read shoebox being the simplest should work, will use code for this as it seems like the most versatile option, however its good to know there are other ways even using shader
     
    Last edited: Aug 28, 2016