- 最后登录
- 2013-9-29
- 注册时间
- 2012-8-20
- 阅读权限
- 90
- 积分
- 6371
- 纳金币
- 6372
- 精华
- 0
|
using UnityEngine;
using System.Collections;
public class LookAtCameraYRotationOnly : MonoBehaviour
{
public Camera cameraToLookAt;
void Update()
{
Vector3 v = cameraToLookAt.transform.position - transform.position;
v.x = v.z = 0.0f;
transform.LookAt(cameraToLookAt.transform.position - v);
}
}
|
|