Watch the clouds move by…
This is not a big deal, but today we’d like to share with you the C# script that moves the cloud layers in Volley Brawl.
We created an UI canvas (Background) and put in some child GameObjects (GO) for all the different image layers. The Clouds GO contains the AnimateClouds.cs script:
The CloudsFront and CloudsBack GOs contain the (x-tiled) images that are to be moved. We’ve dragged all that GOs into the respective public GO variables in our script. The Background GO (which contains the canvas) is put into the public Background GO variable, too, so that the script knows about the screen resolution.
You can set the direction the clouds will be moving in the public enum Direction and you can change the speed of both cloud layers separately. If you like, you could add a part to enable the 2 layers, moving into different directions – for Volley Brawl, both layers are moving into the same direction.
Of course, there are thousands of other ways to achieve the same effect. We just wanted to share with you the option we went for.
Your Fantasy Arts Team