Learning Unity for beginner, Part 2.

Hello again,

As mentioned in the previous post, This post will be about all the problems I’ve encountered and how I resolved them, So, Let’s start:

  1. Glow effect: I was searching on how to apply a glow effect on a scene, there is no direct way to do it, until I found a project from Unity (demo project)  that implementing the effect using a simple c# code and shader, please find the files on this link. Unzip the file and copy them to your project, go to your camera and in the Inspector, click on ‘Add Component’ and search for glow script. This is it, you have now the glow effect on your camera, also you will find some proprieties in the Inspector under the Glow Effect, like Glow Intensity, Blur Iterations, … try to adjust these variable to see how it affect your scene.
  2. Mirrors: This one was a bad ass for me, I’ve tried many solutions, but without any luck to get it work. Please download this file, unzip it and import it to your project. You will find 2 folders (Materials & Scripts). Inside Materials, you will find a file named “Ground Reflection.mat” it’s an object that you can add to the scene, that’s it, drag the Ground Reflection and adjust its position, rotation and scale as you wish, now, you have a mirror reflection :).
  3. Movie Texture Sound: You can add your movie and display it in your scene (like a TV screen), you add it and everything going well, except the sound, the sound will play on the scene and you will hear the sound wherever you go, but I want to attenuate the volume when I get away from the sound source (in my example, the TV), I did a lot of research and tried many things, without luck. To make it happen, you need to extract your movie sound and add it alone to your project. then, add Audio Source to your project, attach your audio file to it, make sure your audio file is marked as 3D sound, set the Doppler Level to 0, and Volume Rolloff to Linear Rolloff, set the min distance and max distance to the values you need and that’s it. your sound file will be eliminated when you are away from it (more that the max distance you set). The key here is to extract the sound from the movie and play each one alone, without this, the audio will be played over all the scene regardless your min/max distance value.

I hope you find these helpful for you. Take care.

Leave a comment