How to check is game object looking on a game object (if condition)

Hi community! I wrote this code:

 promien = Camera.main.ScreenPointToRay(Input.mousePosition);
            if (Physics.Raycast(promien, out trafienie, 100, shootable))
            {
                Transform point = trafienie.collider.GetComponent<Transform>();
                if (//gameObject isn't looking at point position)
                {
                    transform.LookAt(point.position);
                }
                anim.SetBool("Shoot", true);
                Health enemy = trafienie.collider.GetComponent<Health>();
                if (enemy.health != 0)
                {
                    enemy.Damage(fireDamage);
                }

            }

And I don’t know what should I write in the place of condition of this if structure. I want to do this because my player is trying to look at the “point” object even if he is already looking at it causing a weird wiggle bug. Please help me. Thanks!

hi;
that should not happen i mean weird wiggle bug;

u can check that with a new object and test script ;
i always use the " transform.LookAt" without any checking and it has no problem ;

so i think u should search for it another place ,

maybe your shoot Animation or Rigidbody or any thing else ? ;

any way to check that if your player is looking or not u can cast a Ray to the object towards the player with Physic.RayCast;
,