UNITY - CAMERA CONTROLLER

 Code used in the video:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraController : MonoBehaviour {
  [SerializeField]  Transform player;
  float offsetX = 3.0f;
  // Use this for initialization
  void Start () {
    //player = GameObject.Find("Player").GetComponent<Transform>();
  }
 
  // Update is called once per frame
  void Update () {
    transform.position = new Vector3(player.position.x + offsetX,transform.position.y,transform.position.z);
  }
}





No comments:

Post a Comment

ITE 397 Activity

 1. Create a database and name it db_your_family_name (proceed to #2 if it already exist). 2. Create the table tblproducts     prod_id      ...