Answers for "2d Smooth cam follow"

3

smooth camera follow 2d

using UnityEngine;

public class CameraFollow2D : MonoBehaviour
{
    public float FollowSpeed = 2f;
    public Transform Target;

    private void Update()
    {
        Vector3 newPosition = Target.position;
        newPosition.z = -10;
        transform.position = Vector3.Slerp(transform.position, newPosition, FollowSpeed * Time.deltaTime);
    }
}
Posted by: Guest on November-20-2020
1

2d Smooth cam follow

use cinemachine
Posted by: Guest on June-11-2021

Browse Popular Code Answers by Language