Camera follow ahead of the player (3D) Desert Strike style (SOLVED)

Hi all, I am a bit stuck.
Can someone help me out please?

I am trying to re-create a 3D camera smooth follow player ahead like in Desert Strike game.

The camera is looking at the player from a top down view in a 2.5D style with orthographic.
So if a player is moving, the camera should smooth follow the player and look ahead of him.

So far, I got the smooth follow effect working, but I can’t find any tutorial or scripts for sale in the assets store.
Here is a code:

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

public class CamereFollow : MonoBehaviour
{
      public Transform target;
      public float smoothing = 5f;
      Vector3 offset;


      // Start is called before the first frame update
      void Start()
      {
          offset = transform.position - target.position;
      }

      void FixedUpdate()
      {
          Vector3 targetCamPos = target.position + offset;
          transform.position = Vector3.Lerp(transform.position, targetCamPos, smoothing * Time.deltaTime);
      }
}

Thank you for any help!

Well in case you want something like this from the “asset store” without the knowledge how 2 do it,
then just get “Cinemachine”, there are many samples you can use,

it cost nothing since its from Unity itself, and its very powerfull

1 Like

Thanks, I will have a look.

Right, I did check it out and for anyone stuck at the same point. This is actually really good.
I also found this tutorial, which helps understand it fast and easy.

“Easily Control Cameras with Cinemachine in Unity! by Code Monkey”

https://www.youtube.com/watch?v=Ml8ptNeezsU

Thanks for your help !