using UnityEngine;
using System.Collections;
public class test : MonoBehaviour
{
public float angleSpeed = 0.01f;
public Transform target;
public bool isRotate = true;
void Update()
{
Vector3 vec = (target.position - transform.position);
Quaternion rotate = Quaternion.LookRotation(vec);
if (Vector3.Angle(vec, transform.forward)
关注
打赏
Unity实现物体缓慢转向目标
立即登录/注册


微信扫码登录