移动
按方向移动:
transform.Translate(Vector3.方向 * Input.GetAxis("标准输入") * 速度 * Time.deltaTime);
按轴移动:
float translation = Input.GetAxis("标准输入") * 速度 * Time.deltaTime;
transform.Translate((translation, 0, 0);
按X轴移动
transform.Translate((0, translation, 0);
按Y轴移动
transform.Translate((0, 0, translation);
按Z轴移动
旋转(自身中心点)
按方向移动:
transform.Rotate(Vector3.方向 * Input.GetAxis("标准输入") * 速度 * Time.deltaTime);
按轴移动:
float raotation= Input.GetAxis("标准输入") * 速度 * Time.deltaTime;
transform.Rotate((raotation, 0, 0);
按X轴旋转
transform.Rotate((0, raotation, 0);
按Y轴旋转
transform.Rotate((0, 0, raotation);
按Z轴旋转
旋转(外界中心点)
按方向移动:
transform.RotateAround(外界中心点, Vector3.方向, 速度 * Time.deltaTime);