I want to create some on screen arrows using GUITexture so I can control my object on android(Since using Acceleration wasn’t suitable) but I can’t figure it out, any help?
if(Input.acceleration.y >0) //Checking for right arrow key
{
rightThruster.enableEmission = false;
leftThruster.enableEmission = true;
tilt += Vector3.down *0.05;
}
if(Input.acceleration.y <0) //Checking for left arrow key
{
leftThruster.enableEmission = false;
rightThruster.enableEmission = true;
tilt += Vector3.up *0.05;
}
if(Input.acceleration ==0) //Checking if no horizontal keys down
{
rightThruster.enableEmission = false;
leftThruster.enableEmission = false;
}
if(Input.acceleration.x >0) //Checking for up arrow key
{
topThruster.enableEmission = false;
bottomThruster.enableEmission = true;
speed += Vector3.forward *0.01;
}
if(Input.acceleration.x <0) //Checking for down arrow key
{
bottomThruster.enableEmission = false;
topThruster.enableEmission = true;
speed += Vector3.back *0.01;