- Home /
How is this effect achieved (newbie question)?
I'm fairly new with Unity and game development in general so, is there somebody who can bring me some light about this effect?
I want to trigger two things when you select a unit in my game:
First, fade in a circle for the selected units (I think this could be achieved with a Projector if I'm correct).
When selected I want to trigger a effect similar to Wasteland 2, http://youtu.be/icF1Yh8dBbo?t=19m14s , like these waves that appears in the beginning when you select some person.
Thanks.
I would imagine the Waves would be a simple effect animation.
Answer by Raiden-Freeman · Feb 26, 2014 at 05:37 AM
It's not a very newbie question actually xD.
Anyway, to modify the opacity/transparency of something, if it's a game object and not a GUI element, it probably has a renderer and a material associated with it.
What you want to do, is through a script, change the alpha channel of the material's color, based on time. You can use the method Color.Lerp() that "gradually" changes it, given that one of its operands uses Time.deltaTime.
Look at these: http://docs.unity3d.com/Documentation/ScriptReference/Material-color.html http://docs.unity3d.com/Documentation/ScriptReference/Material.SetColor.html http://docs.unity3d.com/Documentation/ScriptReference/Color.html
About the rippling effect, you can easily do this with a shader, though I have no experience whatsoever in that field, so I can't help you. You could though create an alpha channel mask that moves (that means something that moves over your texture, and wherever it has 1/0 the texture is transparent, and where it has the opposite it's solid, with the in between semi-transparent) but that's what shaders do, and I haven't read how to program shaders in unity yet.
Your answer
Follow this Question
Related Questions
Material doesn't apply on iPad but works fine on android 1 Answer
How to force snake tail In Snake game to show the texture that is correct for it 0 Answers
Project texture for krater and scorch effect? 0 Answers
How i can project into the terrain? 0 Answers
angrybot water shader lagging problem 0 Answers