I’m trying to make a 2d scripted gameobject always face the target transform. I tried using a quaternion.slerp but it’s not nearly as reactive as I want it to be and it only works in the instance the target transform is rotating. Are there other means making the 2d scripted gameobject face the target transform or is ther something I need to change in my Quaternion.Slerp?
void Seek (){
Vector3 direction = target.position - transform.position;
transform.rotation = Quaternion.Slerp(transform.rotation, target.rotation, Time.deltaTime * 5);
if(direction.magnitude > minDistance){
Vector3 moveVector = direction.normalized * moveSpeed * Time.deltaTime;
transform.position += moveVector;
}
}