Skip to content

Instantly share code, notes, and snippets.

@curious-username
Last active March 12, 2022 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curious-username/00148660ab4413013d8762f60a0efe8a to your computer and use it in GitHub Desktop.
Save curious-username/00148660ab4413013d8762f60a0efe8a to your computer and use it in GitHub Desktop.
Basic Camera Movement
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