//not sure why it makes no sense works fine on windows
//this is camera code moving the ball according to camera angle
if(!SystemInfo.operatingSystem.Contains(“Android”))
{
midScreen = Screen.width / 2;
if(Input.mousePosition.x < midScreen || Input.mousePosition.x > midScreen)
{
deg = Mathf.Clamp(((Input.mousePosition.x * 0.1f) - (midScreen * 0.1f)), -60, 60);
}
else
{
deg = 0;
}
cameraAngle = deg;
}
else
{
if(Input.acceleration.x != 0)
{
deg = Mathf.Clamp( Mathf.Clamp(Input.acceleration.x, -0.6f, 0.6f) * 100,-60,60);
}
else
{
deg = 0;
}
}
//this is the actual ball movement everything works but the add.force on the X axis
if(IsGrounded())
{
rb.AddForce(Mathf.Clamp(forceX * 9 * Time.deltaTime, -80, 80), 0, 0);
if (!SystemInfo.operatingSystem.Contains("Android"))
{
if (Input.GetMouseButton(0))
{
rb.AddForce(0, forceY * Time.deltaTime, 0);
}
}
else
{
if (Input.GetTouch(0).position.x > Screen.width / 2)
{
rb.AddForce(0, (forceY * Time.deltaTime) * 2, 0);
}
}
}
else
{
rb.AddForce(Mathf.Clamp(forceX * 3 * Time.deltaTime, -80, 80), 0, 0);
}