- Home /
Android, function.
Hello, all. I have made a marble game but i have some problems at the beginning with a button. I have used this script:
var normalTex : Texture2D;
var hoverTex : Texture2D;
function onClick() {
guiTexture.texture = normalTex;
Application.LoadLevel("Menu level");
}
It should be a javascript (I'm really new to scripting). But nothing happends on my android phone (Nexus S, OS: ICS, 4.0) Anyone knows what's the problem what let it do nothing. Ty, for helping me.
Where do you call that function?, and, if you want to make it for android do you need to check the "Touch" function on the manual.
you need to use Input.getTouch(0) or input.touchcount>0 to detect touches
Answer by Eric5h5 · May 29, 2012 at 04:46 AM
There is no onClick function built-in, so that script won't do anything. Unity doesn't use Javascript, it uses Unityscript...the marketing might call it Javascript, but it's not. See the Unity docs for all the functions that are available.