unity3d rotate towards object code example
Example 1: unity rotate towards
Quaternion.RotateTowards(Quaternion from, Quaternion to, float maxDegreesDelta);
Example 2: have something point at the player
using System;
using UnityEngine;
public class LookAtTarget : MonoBehaviour
{
public Transform target;
void Update()
{
if(target != null)
{
transform.LookAt(target);
}
}
}