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

WORKING WITH HEADER-DETAIL FORM IN VANILLA JAVASCRIPT WITH API/PHP AND MYSQL

invoice.html < html lang = "en" >   < head >     < meta charset = "UTF-8" />     < meta name = ...