slow look at question

I have a script that points a gun where you click on the screen but right now it just jumps to where you click instead of slowly rotating to it. How can I make it slowly rotate?

    public Transform gun;
    private Vector3 mouseWorldPoint;
    
    void Update () 
    	{
    	
    		if(Input.GetMouseButtonDown(0))
    		{
   mouseWorldPoint = Camera.mainCamera.ScreenToWorldPoint(newVector3(Input.mousePosition.x, Input.mousePosition.y, -Camera.mainCamera.transform.position.z));
    			mouseWorldPoint.z = gun.position.z;
    			gun.LookAt(mouseWorldPoint);
        }

thanks for your help!

Here you go… change the up vector for the LookRotation as you need… also the speed will of course speed up the look movement

using UnityEngine;
using System.Collections.Generic;

public class SlowLookAt : MonoBehaviour
{
	
	public Transform gun;
	public float speed = 1.0f;
	private Vector3 mouseWorldPoint;
	private Quaternion newLookTarget;
	
	
	void Awake()
	{
		newLookTarget = gun.rotation;
	}
	void Update ()
	{

		if (Input.GetMouseButtonDown (0)) {
			mouseWorldPoint = Camera.mainCamera.ScreenToWorldPoint (new Vector3(Input.mousePosition.x, Input.mousePosition.y, -Camera.mainCamera.transform.position.z));
			mouseWorldPoint.z = gun.position.z;
			
			Quaternion curRot = gun.rotation;
			newLookTarget = Quaternion.LookRotation(mouseWorldPoint - gun.transform.position, Vector3.up);
			
			
		}
		
		if(newLookTarget != gun.rotation)
		{
			gun.rotation = Quaternion.Lerp(gun.rotation, newLookTarget, Time.deltaTime * speed);
		}
	}
}