Home > other >  how can i make a camera follow script?
how can i make a camera follow script?

Time:10-02

hello guys I'm new with unity 3D and I'm trying to make a camera follow script but it does not seems to work here is the script

using UnityEngine;

public class playerfollow : MonoBehaviour
{
public Transform PlayerTransform;
public Vector3 Offset;

public float Smoothfactor = 0.5f;







void lateupdate()
{
    transform.position = PlayerTransform.position   Offset;

}

}

CodePudding user response:

I found a tutorial on YouTube! I'm pretty sure this is what you want.

Brackeys 3rd person movement

Brackeys 1st person movement

CodePudding user response:

Try to use Cinemachine it is smooth and nice :

https://unity.com/unity/features/editor/art-and-design/cinemachine

Or you can make from MainCamera child of player, but it is not smooth... The easiest and very smooth way to do that is Cinemachine.

  • Related