- Home /
Question by
RGI · Mar 30, 2013 at 06:14 PM ·
scenetouchguitextureloadlevelgameobject.find
Touch controls not working after reloading a scene.
Hi, I have 2 scenes, one is the game and the other one is used as an upgrade menu. I have a guitexture in the game scene which loads the upgrade menu, that works fine but when I launch the game from upgrade menu for the second time (it starts with the U menu), none of the touch controls work. Scene loads but you cant do anything. Script in the game menu:
function Start () {
left = GameObject.Find("leftcanon").guiTexture;
right = GameObject.Find("rightcanon").guiTexture;
leftchicken = GameObject.Find("leftchicken").guiTexture;
rightchicken = GameObject.Find("rightchicken").guiTexture;
fire = GameObject.Find("fire").guiTexture;
leftchicken.enabled = false;
rightchicken.enabled = false;
}
function Update () {
for (var touch : Touch in Input.touches){
if (reset.HitTest (touch.position)&& phase == 2 ){
Application.LoadLevel("menuupgrades");
}}}
script for loading the game scene in the upgrade menu is pretty much the same. It just loads a diffrent level.
Comment