Skip to content

Instantly share code, notes, and snippets.

@BichengLUO
BichengLUO / GravityCamera.cs
Last active November 30, 2021 00:37
A Unity3D script for rotating the camera according to the device's accelerometer
using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
public class GravityCamera : MonoBehaviour
{
public GameObject target;
public Vector3 centerOffset;
public float sensitivity = 1000;