Last active
March 12, 2022 23:01
-
-
Save curious-username/00148660ab4413013d8762f60a0efe8a to your computer and use it in GitHub Desktop.
Basic Camera Movement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using Cinemachine; | |
public class POV : MonoBehaviour | |
{ | |
[SerializeField] | |
CinemachineVirtualCamera[] CameraController; | |
Transform overviewCameraTransform; | |
float speed = 4.0f; | |
Vector3 moveingLeft = Vector3.left; | |
// Start is called before the first frame update | |
void Start() | |
{ | |
CameraLabels(); | |
} | |
// Update is called once per frame | |
void Update() | |
{ | |
Movement(); | |
} | |
void Movement() | |
{ | |
overviewCameraTransform.transform.Translate(movingLeft * speed * Time.deltaTime); | |
} | |
void CameraLabels() | |
{ | |
overviewCameraTransform = CameraController[2].GetComponent<Transform>(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment