UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"acceleration controls"
public class ControlAcceleration : MonoBehaviour { public GameObject dishe1, dishe2, dishe3, dishe4; Vector3 accelerationDir; void Update () { accelerationDir = Input.acceleration; if (accelerationDir.sqrMagnitude >= 5f) { dishe1.gameObject.GetComponent<Rigidbody2D> ().isKinematic = false; dishe2.gameObject.GetComponent<Rigidbody2D> ().isKinematic = false; dishe3.gameObject.GetComponent<Rigidbody2D> ().isKinematic = false; dishe4.gameObject.GetComponent<Rigidbody2D> ().isKinematic = false; } } }