I'm building a top-down strategy 2D game, and i'm stuck animating clouds that will float above the arena, hiding other elements. The effect i want to achieve is something exactly like this:
How would i go about implementing it in Unity3D?
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
Most fog of war solutions, probably including the one shown, are shader based. Without knowing much about your project, this is a typical solution in a nutshell:
Create an opaque plane above your map that looks like shadow/fog/clouds or whatever you want to use to obscure what's below. Can be as fancy as you like.
Write a shader that expands the one you were using for the plane but calculates transparency from e.g. a texture passed to it.
Create and update the texture via script and pass it to the shader.
If that approach sounds suitable, this should be a good starting point.
If your game is, like the example, based on a hex (or other non-rectangular) grid, an easier solution might be to create the cloud cover for each cell as a separate object, with a shader using absolute instead of relative texture coordinates so the cells connect and tile seamlessly. This would reduce aliasing at the edges of the concealed area, but might create too much overhead if you have a lot of cells.
PS: Hope I understood your question correctly. If you're just looking for how to make the texture scroll, using Material.SetTextureOffset should suffice in your case. The example you posted looks like it has a semitransparent cloud texture on top of an opaque one, scrolling at different speeds.