this code work great in pc
I can move my ball with this script on pc
but I want control my ball in phone with phone movements
What must I do
#pragma strict
var kamera : Transform ;
var statusText:GUIText;
private var puan :int = 0;
private var sure:float=50.0f;
var zamanlayici:GUIText;
private var oyunBitti :boolean =false;
function Start () {
statusText.text=“Oyun Başladı”;
}
function Update () {
this.gameObject.rigidbody.AddTorque(new Vector3(Input.GetAxis(“Vertical”), 0, Input.GetAxis(“Horizontal”)));
kamera.position.z =transform.position.z-0.001;
kamera.position.y =transform.position.y+10;
kamera.position.x =transform.position.x;
statusText.text=“Puan :”+ puan;
if(sure>0){
sure-=Time.deltaTime;
zamanlayici.text=“Kalan Süre :” + Mathf.Round (sure);
}else{
zamanlayici.text=“Game Over”;
Time.timeScale=0;
oyunBitti =true;
}
if(transform.position.y<-10){
oyunBitti=true;
}
}
function OnTriggerEnter(nesne:Collider){
if(nesne.gameObject.tag==“bonus1”){
puan+=10;
Destroy(nesne.gameObject,.20);
}
}
function OnGUI () {
if(oyunBitti){
GUILayout.BeginArea(Rect(Screen.width/2-150,Screen.height/2,300,500));
if(GUILayout.Button(“Oyunu Yeniden Başlat”,GUILayout.MinHeight(150))){
oyunBitti=true;
sure=20;
Time.timeScale=1;
Application.LoadLevel(0);
}
GUILayout.EndArea();
}
}