- Home /
gui Walkie talkie
Hi in my game, my character brings out a walkie talkie, but there is no signal. i want a gui text to come up and say: there is no signal. Help please!
You need to give more detail as to what you need help with. Do you know how to do GUI stuff?
Thanks for replying! Anyways, in my game, the main character has a walkie talkie. But there is no signal, since there is like a government collapse. So each time the player presses E, a distorted signal is heard from the walkie talkie. But I want a guitar text to pop up on the screen saying: There is no signal. Or something like that. After about 5 seconds, I want it to disappear.
Can you post your script for the walkie talkie? We can then look for errors or fixes
Answer by ReflexGames · Aug 21, 2013 at 11:17 PM
//FadeIn Script for Unity - Zerofractal 2006
var buttonName="Jump";
var fadeDuration:float=0.5;
var initialDelay:float=5;
private var timeLeft:float=0.5;
function Awake () {
timeLeft = fadeDuration;
}
function Update () {
if (initialDelay > 0){
initialDelay = initialDelay-Time.deltaTime;
} else {
if (Input.GetButton (buttonName))
fade(true);
else
fade(false);
}
}
function fade(direction:boolean){
var alpha;
if (direction){
if (guiElement.color.a < 0.5){
timeLeft = timeLeft - Time.deltaTime;
alpha = (timeLeft/fadeDuration);
guiElement.color.a=0.5-(alpha/2);
} else {
timeLeft = fadeDuration;
}
} else {
if (guiElement.color.a > 0){
timeLeft = timeLeft - Time.deltaTime;
alpha = (timeLeft/fadeDuration);
guiElement.color.a=alpha/2;
} else {
timeLeft = fadeDuration;
}
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613112639im_/https://answers.unity.com/themes/thub/images/avi.jpg)