http://www.thedailygreen.com/cm/thedailygreen/images/bug-zapper-TP-med.jpg
I knew that to make this more of a challenge I needed to have some game elements that could kill the player. One thing I really wanted to have in there was an electrified surface, which would zap the player, who then would disappear in a puff of smoke, like a fly on a bug zapper.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuL2awFk8JFsHNw86NVUBhECdYsmkzRYNn2mj811hAMwGnWIcCyEUxbmRUZrLdwc8aVYFJEyAv-sLcV_GyLIDb498GOuuOZV0rhLOo1mbwSlhSyxp94lcyusLJtiBRrb-SdDTKOiQL5vCD/s400/Screen+shot+2011-04-15+at+18.03.15.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk6-HwvpJ8UQ93_DDMM3NquxOf9F77VhxFbEr0OyfBOX1aiXiF9NZ4zDD_u8zxk0mmsIefsdiLTDs9ZeBpK0Clx0g0SZmlarjBKZwr3wWkMz2Zp20-FDhEANAMFMtdEoag7k-oP4FIi-_c/s400/Screen+shot+2011-04-15+at+18.03.59.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj2evUO8_a3G6bPUcN6QnMhxsEFyKleD9uEH0c7qoFkwGzsLhJYAob2WJ2uKBz2FCYr0idHQU5y02zIRAvdKOX0uVKM2j2_Jsyi546zokhgnywXlBz3O7rrMFFWQZzVg6ZzO4Cr2IOzzoj/s400/Screen+shot+2011-04-15+at+18.06.31.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE1wfBG0iyeASOFq-V1yvKKIK9hMkD6YIcupH783eUwbnL_TNn8a1K_vLAY63JpljPM4YL9b_VLSMCFol64QpBkpHDpgM22nRGTXt2qGBePplo93mK4CYD2csg_befzREvEuYjl_sHMtv8/s400/Screen+shot+2011-04-15+at+18.08.51.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVL5HwDQTTHBmPNArMIkHb9aAU65wT-ijQis5j42ZNpIcArwYybPv0AEzMUj_7kpSO5EdDgTrm_vbERFztLQ-9JwhERzBDDjX2xan5xP3R88cI28ojP8caVl-xtuwYYG34iz6KQukZHmNK/s400/Screen+shot+2011-04-15+at+18.25.23.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixE1CCGE5n5dnf4LghAj-1Ye0_1phOJenyGzHfdEzMOM0jEGBolAQ8kaE1mhrfy9_m5vbuv2-ekByGKXzwT6Su01XjKaBGC5kMC6utAs5hJOSQC8JU-g_ZnajejViM13LW3fH_A3dAeSBJ/s400/Screen+shot+2011-04-15+at+18.31.28.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVwdh3HCKGLiYEwbPlq5Xq_C4fTYL7DtTTMPPfz83EEwXLvtZtlhwmg4mvtixylDlZ-4Y2Qaj4bp8FlplqLXSld8136SgSRzUWkPlV9RViy_rSjaWQI1mdj5sUjHiJ8ul3XvfTjmm9f1rp/s400/Screen+shot+2011-04-15+at+18.35.13.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8uCWuqa7LIZ8jOkYteWp5Bgi5SmtRMWDSoLT4b2WuU2TnL4_Jjm1hpbgH0syIww7shKe6-t5QCzWi7JTttDsHaZykgUJeZsdz9JfZy7zqtfQYToQIvR8rUFC5Ddapm2QQSyAvLC6Y8sZe/s400/Screen+shot+2011-04-15+at+18.47.38.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgniLoK3eofe4EECgCdWQo_aVXd1RZT_oslEPkJeLRtTEYf5vI4e5C85y-ybpW-S7CkKHTzEDIYIgiYClQZCeeA4PAln2v3VrSG6qeN4HS96huqEOnlfQl7-VXDShpO4yaJqShuIPASK5s_/s400/Screen+shot+2011-04-15+at+18.55.49.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUIhLTgui7Xz6y1vwAXH7FYgqwe1xzsNWNKo424TI5AI6mS_2qh-l6puL5fi5DZ6C0Y-c-VelydJlX7WKpRHjbcbLpvKhXPu_GUrkcwXqiQRsKUXP8YMJR35n6gIKAUg3uKnlBWv5e_kAj/s400/Screen+shot+2011-04-15+at+18.56.07.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHiZU9gT_lU5Ayx7I9bUqr25SXwkCNn9zEROKQuxO7pUmhAg47rQrraL-ogGhKdRpmk2xHhB6Ivu3HtZ13AKbQ9L7APRQKmalFMXmuClzqcitB2c9-70bk3AXwuZWFAGj9qeqq4n_H3a_8/s400/Screen+shot+2011-04-15+at+19.15.08.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl98yeI1hfP54MZsuMO5cCK1BJrAQMkhU80xot61dfDSnZ0Co7CHCXrvgb7jtKxxO7dGnPxXOyn35GHez6MOkcp1Cje8fXWirV5h7t3T9L-u7uml_lHLfR1wZAykDygTJPVfl6ugcEwlEg/s400/Screen+shot+2011-04-15+at+19.15.53.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7nbAuSZNUzddJc7Aw2KzcW3_znu_cUcKRDhrhXVx9-57Bu9vZRRmT6Nv-MN0Tnw2-rJnHyI4iWiYki8ETYHudVwUwm2KJuCMImOKXX03-2bSXwwkDA-L94qaynFfrKI28Awivnt0YQvBo/s400/Screen+shot+2011-04-15+at+19.32.00.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIl4CIqlEwKVbOD41x8HNNQmVRI2ewrAQghmlt3O-EKhW0EOvYj7dDGuCeshEFApf3FKnA_3kQwTY4GyLE5mZj5Bq96Vf7W268jQXnBb80WBPvu6njT_jtpTrCPOBlX2hnqURz7sS7jtAe/s400/Screen+shot+2011-04-15+at+19.36.19.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwVy91-yuXADyKCE6ol6HQDm6vqBqGy1ZUYSuXvdGqm-XmzYSovCfK9G24qMtwMlOzeTBAcs7nVLDvgny2hTyA0oKhyZO6ToR4JONsvScWJcRdrU_egTlSG8NDKzw-Yc1AA75tQQtatgTk/s400/Screen+shot+2011-04-15+at+19.40.32.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcqWdGHahhQKZrWjQV7UclGvx_01sfvOVA3bvMEEsPY5Cdj2lx94yKGtPx0ww7HYiULDd4xfR-sp0WApKZb17gwO_8GyLOxZT3fr2_h4yXnwFMTltYhjYQ-IpU33NckOarJj_mPzZucnlj/s400/Screen+shot+2011-04-15+at+19.49.28.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV9zti-93bmzWssfrACqHun-RlO1b0R1sV2vyIZ_hAqjN6ejQ7TaJTsfAQB-xokf5MW_TqmIp0PwP_p11V4DHXqBJQ672An08JQHkWglKUaiUGr7GCRopahnIQdFXy596jXJBzOI5ZRCFh/s400/Screen+shot+2011-04-15+at+19.57.41.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdM86BqhdG766hGbWBt5bNIPuSbqw_UxMpzA5c8CIJj3BpJRXqo7OtWMbIOTdJ7UV8UJjBAi0bod3rBST-QJ98Zf5w4NIAeSUN6Pj1c6fsPVBv111XoPxvyCfI0B5vmuxfATtLxzstXU6h/s400/Screen+shot+2011-04-15+at+20.11.45.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFn4X7rlZCvXja8CNKxxD_sZ8yHAIOIXRljRlT1ZP4EVd4N8m6iqfvtPQ-I7UfOIV60LcNZgQP42DwiBMvdsCh2BxK73nJoZPFdKEKy5Ll9CU2ZQPwceGdKpADlYb1S819F4d9pJYDHzE_/s400/Screen+shot+2011-04-15+at+20.27.40.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1_UXg3wRhVod_mT4rGLUvx-C-EPMItU2ip0G8a9xOCIq8w02CSMWXMBrsSaVQde0cTc8X6ajlltPCDLBSfX0BAqBTJx5RqHI1t72rRgcex468Vd5jV1_ukLgsaaccwkC5bgZ60z9e5HIy/s400/Screen+shot+2011-04-15+at+20.27.28.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKACpamBQ-fQ8Ndf1ndZ5DX0RpyvXsEeaYmnv8EJZCyDiiD9ZZz2JgHAf0hXkW1sldDTEw-9tUo-7K3wDTObTymEHL8OPU6QiphE98m7awbQO-8a8lTJV4D0OyVgFJhyfS12WWEMDjjr4g/s400/Screen+shot+2011-04-16+at+09.17.59.png)
So I went into After Effects and searched for "electricity" and "lightning" in the presets and found a preset called "lightning bend".
20. I altered the midtones to a be a blue colour.
21. I then altered the blur for a less pixelated effect.
22. I then resized the effect so that it would look better over the mesh.
23. I added some key frames for rotation and tried to make it so the effect would loop fairly well and look as seamless as possible.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSPPt2LcWUjF2xISPItxurKodPCrAOkl8ZvSYAE2vjgYTGtmDPUowhHEJukTMobmEDLYVwpBIj9KyMTSEyrgAKoavHaN_qNdaIE7AjJeXLNnU7glrrmCgregDxujkQvgywV5ZXjpp2uBj7/s400/Screen+shot+2011-04-16+at+09.24.08.png)
24. Because it still looked a little bit too uniform in its movement and not as random asI would've liked, I split the clip up and staggered them about, however this looked a bit too much like clips cut together so I reverted back to the single clip and instead, altered the evolution level of the fractal noise, which looked much more lively than the previous version.
25. I exported the cropped composition as a png. sequence and changed the output channels from "RGB" to "RGB + Alpha" to export the transparency. I also needed to compromise on size and frame rate, because although it would have been nice to have each frame 1024x1024 and run at 25 fps, this would've meant that the actual texture png file would need to have over 130 million pixels, which would be impractical and impossible. I instead decided to opt for 5 fps and a resolution of 256x256, meaning I could create a simple 1280x1280 image, with each frame laid out on a 5x5 grid (1.6 million pixels).
26. So I laid each frame out on the grid in Photoshop and discovered that some of the black add been exported with the composition, so rather than go back and re-export, I decided to correct this in Photoshop.
27. I duplicated the layer and desaturated all of the colour out of the image then copied and pasted this grayscale image into the alpha channel of the coloured layer.
28. This was the result. I now save this as a .psd, imported into Unity and attached the AnimatedTextureUV.js from http://www.unifycommunity.com/wiki/index.php?title=Animating_Tiled_texture, to create a nice animated electricity effect to overlay on my existing electrified box.
27. To complete the illusion of a high voltage electric hazard, I added a generator sound clip from http://fxhome.com/sounds/ and adjusted the roll off, so that the electric buzzing sound became louder, depending on how far away the player is from the electricity. This really completed the effect.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN9G7O0Lm2mWBSOgYKB6fGrfWTGvvVc6xov2jkxUfBzfljKjJywW7wjZwwMieaXFlUwABF0b725JX_c4n2JVTUa-ZTM_mnv0FUw6aSbGbRtFxWLB7CSbWNv1FUrP6Wwllt4AfYoM9xcFna/s400/Screen+shot+2011-04-16+at+09.18.11.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPyEufynM33xKTOiZxM7rwkuZxqhBmJ42AhsDw0DYzTro_Z1prTG0fra-JowLToduKA-qmh4erYH7n_uh5MVOavqbSYi2-ZQYfDxv8elFnph_IFTkUXJgw3m_J-W5QKS5lEhGSYSPq3q2J/s400/Screen+shot+2011-04-16+at+09.18.33.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggSpYkCMBk9fpTSiTTB3Mor-OnxyZzRhTUX_fEVMEN-ySl8khQYYce4qahJGaS_YGvi09oXKR3zzqfGoTfPTDO7WYlKGadFRPdx_kvr4C4xGJavq_AuVzoM-x3iJEM0JdaD-Hvr46d0rLN/s400/Screen+shot+2011-04-16+at+09.18.48.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifqNwi-vjM4jnNe8IbGDGM6k3ka4WfqR_SGoKRF5fP3YgX_YrThyRl7TDwSzoxA0AQwtBAUzwTyraArPasSPW-DHi30nGRPVIg09HFIlrRhEY8rgML67_rKilSSuPUNn2DAVBUZ2nVIKnv/s400/Screen+shot+2011-04-16+at+09.22.33.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSPPt2LcWUjF2xISPItxurKodPCrAOkl8ZvSYAE2vjgYTGtmDPUowhHEJukTMobmEDLYVwpBIj9KyMTSEyrgAKoavHaN_qNdaIE7AjJeXLNnU7glrrmCgregDxujkQvgywV5ZXjpp2uBj7/s400/Screen+shot+2011-04-16+at+09.24.08.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx9RTtzljcZpDxa5XWiUQ1mwCv1qpHAh12YUgfW7d3glzLlN5iw6i92RKcShYJ3dvMiV0hYow5tiwh4bJ_Bj_a3zQ60OuMdwkQ5tRcM5Yt6JV9B8rjLhySsHJMb3J7_dCPOQytY5_YS44E/s400/Screen+shot+2011-04-16+at+09.27.42.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZM5QKWam9Sm63CCKClRpUNHg1ABVQhXfoXawGvNOd04SPj-9JVD2XIUKb2_-Zo_e0vW_DuBsYxMl5b-1Xdq8CKgwD8S3kLq_FCpXbZ7c7lKbrT0TuYgi7C5YfKlTiGa8JXGn-fj6LTb_h/s400/Screen+shot+2011-04-16+at+09.40.21.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEine3iEvV3OSez0Mj98ZXy7-WccuHlapidnMecvpaaNxMB3ys-O6NQlAL9Y0BjkmwQqLnyWLLkdNwAnwTfn7WAim2aQMkN6Ch_TA47ltuCIVBJgZUx1H-X54gj4pCQeQfs0chgAG8iNKYQm/s400/Screen+shot+2011-04-16+at+09.53.19.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGhGhxeaG91FMtCg-_MXWCPhyphenhyphenUzBddpg1CUEEMLBroWkLmGxRDsxCw2Pm3RuqsONZws5CRuJFrzJcX6DDYHtq5UowxzV9cj_2JdtJQJTB-7INMEuIJRZaUXcpWVKEin2aaF6koifoM5le7/s400/Screen+shot+2011-04-16+at+09.58.09.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEif9L-0F84Y_WT3fsqjQipnBPPevCnokWXT1tHm48VT7D46FFwBen1V0bnOVTdmCd0ekFLZJEUdB0HzHn2kF_h33SP4BYLsTeMW-hh0jL0rzBsodyMpKKj2ApAbjFkClGuxfA9QCDlmFu3U/s400/Screen+shot+2011-04-16+at+09.58.28.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo9dJAkaDZk3RUG4SnAZjSkGUjwO7SLQqJTwZJ4T1gcfjlbgsZKFqiJ8-OAPxzCUTsmGtgxAxub1YdmfeKCodzojfZVcwiTXO0cQkqKEgE5rcU5dY-gfdXPpcBTuPOi-9anVBpxRl49v0h/s400/Screen+shot+2011-04-16+at+10.17.46.png)