- Home /
On trigger enter fade in gameobject ?
Hello, I was wondering if and how you can fade in a gameobject when a player walks into a trigger, I have a scene set up where I wanted a area that a play walks in a game object of a wall will fade in (kinder like a force field) and I was wondering how do you go about doing that in Unity (java-script format if you could)?
Thank you for your time, have a nice day.
Answer by Unity_gamer · May 17, 2013 at 01:00 PM
Yes it is Possible to do that.
Make sure the shader you are using contain Alpha content
Change the Alpha value from the color
You can lerp the Alpha value to 0 - 1 or 1 - 0.
Use this for reference
http://docs.unity3d.com/Documentation/ScriptReference/Material-color.html http://docs.unity3d.com/Documentation/ScriptReference/Color.html http://docs.unity3d.com/Documentation/ScriptReference/Color-a.html
Hope this will help you
Thanks
Your answer
Follow this Question
Related Questions
Why isn't OnTriggerEnter/Exit working? 2 Answers
Multiple Colliders Trigger problem 2 Answers
Unity crashes after I destroy a gameobject 1 Answer
Destructible GameObject OnTriggerEnter2D getting called twice 1 Answer
Fading a GameObject in/out 1 Answer