hi ! im new here
can anyone tell me that how to make accelerometer control in a game for android device ?
for example : if i want to run my character in left direction using accelerometer , so what should i type in the script ?
Vector v = getAccelerometer();
if(v.x>0.2) // moving right
{
x+=5;
}
else if(v.x<-0.2)
{
x-=5;
}
Users browsing this forum: No registered users and 1 guest