Skip to content

Instantly share code, notes, and snippets.

@Yecats
Last active October 16, 2019 03:33
Show Gist options
  • Select an option

  • Save Yecats/a1a45f42e9a199ff4327da0c84e5f79a to your computer and use it in GitHub Desktop.

Select an option

Save Yecats/a1a45f42e9a199ff4327da0c84e5f79a to your computer and use it in GitHub Desktop.
public class CameraController : MonoBehaviour
{
[Header("General Properties")]
public GameObject CameraRig;
private Camera _actualCamera;
//Movement variables
private Vector3 _moveTarget;
// Start is called before the first frame update
void Start()
{
// Store a reference to our camera
_actualCamera = CameraRig.GetComponentInChildren<Camera>();
// Set the initial _moveTarget to the rig’s position.
_moveTarget = CameraRig.transform.position;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment