Smooth Look at...

Gosh I’ve been searching for that like hours and there are tons of questions already out there I copy and pasted all of them I went through them searched for errors but I just couldnt manage to have an object smoothly rotate towards my first persons character.
So what I then did was:

person.transform.rotation = Quaternion.Lerp(person.transform.rotation, kamera.transform.rotation, 0.1f);

Now that at least did something, but it turned the object that should look at me in the completely wrong direction and on all axis, I only wanted to move on the Y-axis. So I did this

person.transform.rotation = Quaternion.Lerp(person.transform.rotation, new Quaternion(0, kamera.transform.rotation.y, 0, kamera.transform.rotation.w), 0.1f);

and finally the object (“person”) rotated only on the y axis and completely parallel to my Rotation, but still in the wrong direction! So I found out that Unity’s Rotation does not go from 0 to 360 but rather from -1 to 1 and so to Switch the Rotation all i had to do was multiplying with -1, I thought. So I changed “kamera.transform.rotation.y” to “kamera.transform.rotation.y [times]- 1” but guess what happened? That shitty object still rotates in the complete opposite and yes I saved the script I also did Debug.Log to see if it executes that code and it did!! >.<
Also now the object at some points does not rotate at all anymore or in some weird direction (after adding " [Times] - 1").
How can I do this? And why is Unity so damn complicated with the easy things?

By the way: If you see “MINUS 1” I mean “TIMES MINUS 1” but somehow when i write * - 1 it Automatically turns into -1
Edit: Ok now it writes it in that sentence ↑ Interesting…
Ededit: I think it has to do with the Feature that stars make text bold I changed them to [Times]

I actually found a better option that worked for me, because the Update only gets called once per frame you can take to rotation of the LookAt and use that to lerp with.

Quaternion OriginalRot = transform.rotation;
transform.LookAt(Target);
Quaternion NewRot = transform.rotation;
transform.rotation = OriginalRot;
transform.rotation = Quaternion.Lerp(transform.rotation, NewRot, speed * Time.deltaTime);

This is a script attached to the camera therefore the transform is the cameras. Hope this helps people.

The rotations are not mapped from -1 to 1 in the same sense as a 0-360 range. the reason they are represented as four numbers in that range is because they are represented as Quaternions, A good rule of thumb is to never mess directly with the x,y,z,w values of a quaternion unless you know what you’re doing (or are a wizard, those guys can do what they want). If you want to observe/modify the angles of a transforms rotation in a more user friendly way, try looking at the transform.rotation.eulerAngles, which will be in degrees.

But in regards to the problem in general you are having. here is a quick script that will get the object it is placed on to smoothly turn to face the target object, but will only rotate around the Y axis.

using UnityEngine;

public class TestLookAt : MonoBehaviour
{
    [SerializeField]
    private Transform m_Target;
    [SerializeField]
    private float m_Speed;


    void Update()
    {
        Vector3 lTargetDir = m_Target.position - transform.position;
        lTargetDir.y = 0.0f;
        transform.rotation = Quaternion.RotateTowards(transform.rotation, Quaternion.LookRotation(lTargetDir), Time.time * m_Speed);
    }
}

Also keep in mind that these rotations are based on the idea that your objects “facing direction” is along the positive Z axis, If your object is not set up like this then it will likely always face in the wrong direction but consistently in its offset.