Smooth 2D Camera Follow In Unity3D

This is just a nice short and simple script that I sometimes use to make the camera in Unity smoothly follow an object. Just add this script to a orthographic camera and select a target and follow speed in the inspector.

The Code

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);
    }
}

Microsoft Visual Studio in Linux with Unity3D

Guide on how to get Microsoft Visual Studio in Linux using Virtual Box Continue reading

Circle Loading Animation In Unity3D

Published on January 08, 2017

System Subversion Introduction

Published on January 04, 2017