- Home /
I Need a script for a guitexture enableing a spotlight and play a sound when pressed
Here's the script i used:
var Flashlight : GUITexture;
function OnMouseUp(){
audio.Play();
if(light.enabled == true)
light.enabled = false;
else
light.enabled = true;
}
it's not working, it only plays the audio, and says "light has to be attached to the guitexture" but when i put the spotlight ON The guitexture IT GOES AWAY FROM THE PLAYER AND MOVES TO THE GUITEXTURE POSITION. So idk what to do, the spotlight don't move when attached to the gui, and when i get the gui and move it to the player, the gui goes off screen.... so i need some help.... hurry and thanks :(
Edit: CAN YOU GUYS HELPPPP
What do you want to happen? If you put a guitexture and light on the same object, there is only one transform, so both will be in the same place. Did you want the light to follow the player?
I would love to help but you need to be clearer. Is this meant to be for a button?
Do you want it that when you click the GUITexture the light turns on or off and a sound also plays?
Answer by nick12343 · May 08, 2013 at 12:43 AM
PLEASE HELP MEEEEEEEEEEEEEE :(
I see you answered your own question, so we can all ignore it now. Ha. You should NOT answer your own question to bump it. Comment ok. Edit ok. Answer, no.
Your answer
Follow this Question
Related Questions
how to check if touching an guitexture android 0 Answers
pause and restart button on android 1 Answer
Unable to reactive the game object 1 Answer
GUITexture buttons in Android are too sensitive 1 Answer
GUITexture and GUIText on android 2 Answers