soundvision/UnityProject/Assets/Scenes/Examples/First Project/Scripts/FaceCamera.cs
2020-01-21 23:31:06 +01:00

17 lines
382 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FaceCamera : MonoBehaviour
{
[SerializeField] Transform target;
void Update()
{
if (target != null)
{
transform.LookAt(transform.position + target.transform.rotation * Vector3.forward, target.transform.rotation * Vector3.up);
}
}
}