Just starting out on developing for Android and quickly bumped into a problem - I have a player in the shape of a space bar that is restricted only to the movement on the X axis and tilting the tablet causes it to move left or right. The problem is that if I tilt the tablet at angles at around 45° while the player is colliding into a wall it can clip through it with ease.
Here is the script for the player controls (in C#):
using UnityEngine;
using System.Collections;
public class AccelScript : MonoBehaviour
{
public float SpeedMultiplier;
// Update is called once per frame
void FixedUpdate ()
{
transform.Translate (Input.acceleration.x * Time.deltaTime * SpeedMultiplier, 0, 0);
}
}
Help will be appreciated!