您当前的位置: 首页 >  unity
  • 3浏览

    0关注

    193博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Unity实现物体缓慢转向目标

我寄人间雪满头丶 发布时间:2021-05-04 02:20:05 ,浏览量:3

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)             
关注
打赏
1648518768
查看更多评论
0.1620s