Advertisement
LeeMace

Camera first person

Nov 29th, 2022
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | Gaming | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class FollowPlayer1stPerson : MonoBehaviour
  6. {
  7.     public GameObject player;
  8.     private Vector3 offset = new Vector3(0, 2, 0);
  9.     void Start()
  10.     {
  11.        
  12.     }
  13.  
  14.     // Update is called once per frame
  15.     void Update()
  16.     {
  17.         transform.position = player.transform.position + offset;
  18.  
  19.     }
  20. }
  21.  
Tags: camera
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement