Hey guys I just coded the camera to follow the player I used the Code that was in Unity Tutorial 3/10 Survival Shooter Game. Did I do something wrong in the code to make this happen or am I supposed to have the character in a certain place?(Also my first time using Unity so I really do appreciate the help Thanks) Here is the code I used:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFollow : MonoBehaviour {
public Transform target;
public float smoothing = 5f;
Vector3 offset;
void Start()
{
offset = transform.position - target.position;
}
void FixedUpdate()
{
Vector3 targetCamPos = target.position = offset;
transform.position = Vector3.Lerp(transform.position, targetCamPos, smoothing * Time.deltaTime);
}
}