My DIY Camera Follow Script :)

Hello guys ,
in the script i used i preferred to use GameObject.Find function because FindGameObjectWithTags caused compiling errors which i think is becasue I am using Unity 2017 currently. Also I saw a lot of use this function even before this project.So enjoy :slight_smile:

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

public class CameraFollow : MonoBehaviour {

//Use this for initialization
GameObject CameraArm; 
GameObject Player;
void Start () {
    Player = GameObject.Find("Player");
    CameraArm = GameObject.Find("Camera Arm");

}

// Update is called once per frame
void LateUpdate()
{
    CameraArm.transform.position = Player.transform.position;
}

}

1 Like

Thanks much more simple and esay to apply :smiley:

1 Like

Privacy & Terms