Hi! I’m working on a GUI for class, and I can’t get part of it to work the way I want with the game it’s for. Any help would be great!
So I am using a GUI.RepeatButton, so I can hold down the button to recharge the characters energy. That functions ok for now, but I have a particle effect attached to the character that renderer.enabled = true; will make it show up. The problem is that it wont stop rendering when i let go of the button. If you need more of the code to understand what i’m doing just let me know! Thanks a ton!
//ENERGY COIL BUTTON
if (GUI.RepeatButton (Rect (Screen.width - 613,Screen.height - 84, 65, 63), GUIContent (icon, coilTip) , coilOne)) {
if (playerEnergy==1)
{
coilEffect.renderer.enabled = false;
}
if (playerEnergy<1)
{
coilEffect.renderer.enabled = true;
}
}
I’m more of an artist then a coder, so it’s been an adventure getting this far! ![]()