Your Cart
Loading
Smooth Camera Follow Unity 3D Unity Camera Follow Player 3D Make Camera Follow Player Unity 3D unity tutorial

Smooth Camera Follow Unity 3D | Unity Tutorial

Smooth Camera Follow Unity 3D | Unity Tutorial


In this quick tutorial, learn how to create a smooth camera follow effect in Unity 3D. We'll guide you through setting up a camera that smoothly tracks and follows a player character using simple scripting and Unity’s built-in features. Perfect for enhancing your game's camera dynamics and providing a polished player experience!



WATCH FULL TUTORIAL ON YOUTUBE



CHECK OUR PROJECTS


SUBSCRIBE FOR LATEST OFFERS



=========================================================


Unity Projects - ON SALE!!!


1. Water Sort Puzzle 9000 Levels

https://payhip.com/b/cjDb8


2. Ball Sort Puzzle 9000 Levels

https://payhip.com/b/IbtoD


3. Sling Shot

https://payhip.com/b/PjLDH



=========================================================



Script:


using UnityEngine;


public class CameraFollow : MonoBehaviour

{

  public Transform player;    // The player's transform

  public Vector3 offset;     // Offset position from the player

  public float smoothSpeed = 0.125f; // Speed at which the camera follows


  void LateUpdate()

  {

    if (player != null)

    {

      // Calculate the desired position

      Vector3 desiredPosition = player.position + offset;

      // Smoothly interpolate between the camera's current position and the desired position

      Vector3 smoothedPosition = Vector3.Lerp(transform.position, desiredPosition, smoothSpeed);

      // Update the camera's position

      transform.position = smoothedPosition;

    }

  }

}





DOWNLOAD CODESTER FILES