Free camera with zoom, panoramic and rotation around a target

Hello,

I recently used a script which rotates, zoom in and zoom out around a target. Unfortunately, I haven’t retrieved this script and all the camera scripts I’ve found (standard assets or others) only include the rotation.
Does somebody has a link or a script available which would infinitely rotate and zoom around a target?

Thank you to you!

Might I ask why you’re not trying to create such a script yourself? It’s not really hard, and I’m sure you’ll learn a few things along the way, rather than just with using a premade script.

Yes, I understand your question. But I lack time and I already used one which did perfectly the job. So, I prefer using what is already functional.

Hey,

Here is a script i just wrote for you, hope it helps.
FYI, it took me 20 minutes and i consider myself to be a beginner at C#.

using UnityEngine;
using System.Collections;

public class Camera_Rotate_Zoom : MonoBehaviour {

    // Camera Target
    public GameObject Target;

    // Axis for rotation
    public int Axis_X;
    public int Axis_Y;
    public int Axis_Z;

    public int SpeedRotation;
   
    // How ZoomedOut and In you want your FOV
    public int FOV_ZoomIn;
    public int FOV_ZoomOut;

    // Speed of the zoom : float Between 0 and 1
    public float SpeedZoom;
    public int TimeBetweenZooms;

    private bool IsZoomed = false;

    IEnumerator ZoomingIn(){
        Camera.main.fieldOfView = Mathf.Lerp(Camera.main.fieldOfView, FOV_ZoomIn, SpeedZoom);
        yield return new WaitForSeconds(TimeBetweenZooms);
        IsZoomed = true;
        Debug.Log("Zoom IN");
    }

    IEnumerator ZoomingOut(){
        Camera.main.fieldOfView = Mathf.Lerp(Camera.main.fieldOfView, FOV_ZoomOut, SpeedZoom);
        yield return new WaitForSeconds(TimeBetweenZooms);
        IsZoomed = false;
        Debug.Log("Zoom OUT");
    }
   
    // Update is called once per frame
    void Update () {
        transform.RotateAround (Target.transform.position,new Vector3(Axis_X, Axis_Y, Axis_Z),SpeedRotation );
        Debug.Log(Vector3.Distance (transform.position, Target.transform.position));

   
        if(IsZoomed == false){
            StartCoroutine("ZoomingIn");
            Debug.Log("Zoom IN");
        } else if(IsZoomed == true){
            StartCoroutine("ZoomingOut");
            Debug.Log("Zoom OUT");
        }
    }
}

Thank you for your help!
Here is an other script which works fine as well

using UnityEngine;
using System.Collections;

public class NouveauSmoothFollow : MonoBehaviour
{
    Vector3 randomRotation;
    Vector3 randomModRotation;
   
    void Start()
    {
        randomRotation = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f));
        randomRotation = Vector3.Normalize(randomRotation);
        randomModRotation = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f));
        randomModRotation = Vector3.Normalize(randomModRotation);
    }
   
    void Update()
    {
        float orbitDistance = 10.0f + (Mathf.Pow(Mathf.Cos(Time.time * 3.14159265f / 15.0f) * 0.5f + 0.5f, 3.0f)) * 35.0f;
        //orbitDistance = 30.0f;
       
        Vector3 pos = Quaternion.Euler(randomRotation * Time.time * 25.0f) * (Vector3.up * orbitDistance);
        transform.position = pos;
        transform.LookAt(Vector3.zero);
    }
}