好的,我只想用iTween RotateTo在一个轴上旋转一个对象,所以我有以下几点:
iTween.RotateTo(this.gameObject,iTween.Hash(
"x", this.gameObject.transform.eulerAngles.x+90,
"time", 60,
"easetype", "easeInOutSine",
"looptype","pingpong"
));我尝试过允许旋转到某个位置的iTween函数,但我得到的结果是,对象根据目标的位置向上或向下倾斜。我只想要y轴。
隔离这个轴,但是我需要用指向目标的任何方向替换this.gameObject.transform.eulerAngles.x+90。我尝试过Quaternion.LookAt,但是iTween抛出了一个类型错误。
如何将Quaternion.LookAt转换为eulers?
发布于 2019-04-11 03:08:16
我认为你需要做的就是在你的rotate方法中添加local参数,以便在gameObject的局部变换中保持上方向轴:
iTween.RotateTo(this.gameObject,iTween.Hash(
"x", this.gameObject.transform.eulerAngles.x+90,
"time", 60,
"islocal", true,
"easetype", "easeInOutSine",
"looptype","pingpong"
));https://stackoverflow.com/questions/55555953
复制相似问题