Hello, I was trying to make a 3d object(cow) that will rotate towards the main character. I added an 'Area' and a 'CollisionPolygon' to the cow and it works just fine, every time when the main character enters the area 'Entered' is printed in the console.
The issue is the following: whenever I enter the cow's area is turns away from the main character and if the main character goes around and enters the area again, the area detects him, but the cow doesn't rotate.

Here is the entire script for the cow:
extends KinematicBody
var g=9.81
var gravity=Vector3()
var target
const speed=5
const acceleration=10
var direction=Vector3()
var velocity=Vector3()
func _process(delta):
if not is_on_floor():
gravity.y-=g*delta
move_and_slide(gravity, Vector3.UP)
if target:
look_at(target.transform.origin, Vector3.UP)
func _on_Area_body_entered(body):
if body.is_in_group("Player"):
target = body
print("Enter")
func _on_Area_body_exited(body):
if body.is_in_group("Player"):
target = body
print("Exit")
P.S. it is a tpp type game