Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hello. One question....how do you control the camera? Did you use any asset? Which one? thanks

(1 edit)

No I didn't use any asset. I made this simple script. 

using UnityEngine;
public class CameraFollow : MonoBehaviour
{
    public GameObject player;
    GameObject startTarget;
    public float timeOffset, gameViewSize, zoomSpeed = 1, timeBeforeMoving = 1.5f;
    public Vector3 posOffset = new Vector3(0, 0, -10f);
    Camera cam;
    private Vector3 velocity;
    private void Start()
    {
        cam = GetComponent<Camera>();
        
        if (!startTarget)
            startTarget = GameObject.FindGameObjectWithTag("Finish");
        
        transform.position = startTarget.transform.position + new Vector3(0, 0, posOffset.z);
    }
    void Update()
    {
        if (cam.orthographicSize != gameViewSize)
            cam.orthographicSize = Mathf.Lerp(cam.orthographicSize, gameViewSize, Time.deltaTime * zoomSpeed);
        if (Time.timeSinceLevelLoad > timeBeforeMoving)
            transform.position = Vector3.SmoothDamp(transform.position, player.transform.position + posOffset, ref velocity, timeOffset);
    }
}

Wow!!! and the blur effect on the sides?? Fantastic to know...thanks

That is lens distorsion in post processing with URP.