using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RotateWithPlayer : MonoBehaviour
{
    [SerializeField] private float smoothing = 0.05f;

    private Vector3 m_AngularVelocity = Vector3.zero;
    private Quaternion initialRotation;
    private Quaternion targetRotation;
    private Quaternion difference;

    void Awake()
    {
        initialRotation = gameObject.transform.rotation;
        targetRotation = initialRotation;
    }

    void FixedUpdate()
    {
        targetRotation = GameObject.FindWithTag("Player").transform.rotation;
        transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, smoothing);
    }
}
