18 lines
426 B
C#
18 lines
426 B
C#
|
|
using UnityEngine;
|
|
|
|
public class LookAtY : MonoBehaviour
|
|
{
|
|
//void Update()
|
|
//{
|
|
// Vector3 v = (transform.position - Camera.main.transform.position).normalized;//0.0
|
|
// transform.forward = v;
|
|
//}
|
|
private void LateUpdate()
|
|
{
|
|
|
|
transform.LookAt(transform.position + Camera.main.transform.rotation * Vector3.forward,
|
|
Camera.main.transform.rotation * Vector3.up);
|
|
}
|
|
}
|