unity的Gobal和Local有什么区别,能详细点吗?为什么有时z轴不动,旋转z轴,x,y的R

2025-04-07 15:17:48
推荐回答(1个)
回答1:

if (Input.GetKey(KeyCode.D))
{
this.transform.localRotation.y=90;
}

这句话是否写在OnGUI方法里面去了,如果是,请写回Update方法中。
没有的话,就改变一下
transform.Rotation(Vector3.up*90)