如何解决如何使彼此相对旋转? Unity 2D
我对此脚本有疑问
using System.Collections.Generic;
using UnityEngine;
public class ObrotPily : MonoBehaviour
{
private float rotate;
public float rotateStrong;
void Update()
{
rotate += rotateStrong;
transform.rotation = Quaternion.Euler(0,rotate);
while (rotate > 359)
rotate = 0;
}
}
问题在于,对象(4个锯)在绿线上移动,但它们应沿蓝线(彼此移动),它们应该 转蓝线。
解决方法
只需使用.localRotation而不是.rotation,它应该有帮助
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。