- Home /
Gui Text popup, fade out
Hi there!
I would like some help with a script I'm working on. It's a battery pickup script, so when you pickup a battery a text pops up in the bottom left corner that says that you collected a battery.
I want it so when the text pops up it should fade out after a couple of seconds. Now they just stacks on top of each other by using an array.
Here's my Inventory script:
var batteries = new Array();
var guiSkin : GUISkin;
function OnGUI()
{
for(var i : int = 0; i < batteries.length; i++)
{
GUI.skin = guiSkin;
GUI.Label(new Rect(90, Screen.height - 60 - (i*60), 120, 50), ("Picked up Battery"), "HUD");
}
}
I hope you guys understand!
Answer by VesuvianPrime · Sep 13, 2014 at 02:17 PM
You can control the color of your GUI via GUI.color
You can fade the gui over time by using coroutines (this manual page specifically talks about implementing fading)
Your answer
![](https://koobas.hobune.stream/wayback/20220613162921im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Where do I assign GUI scripts? 1 Answer
Customizing GUI buttons 1 Answer
ignore left mouse button click in game when clicking on gui buttons 1 Answer
GUI Button to a GUI slider help ? 0 Answers