我正在为手机创建一个游戏镜头(带有宇宙飞船):)
我在PlayerMovement class / void update ....
中有以下代码//Rotaciona a Nave
Quaternion rot = this.transform.rotation;
float z = rot.eulerAngles.z;
z -= Input.GetAxis("Horizontal") * rotSpeed * Time.deltaTime;
rot = Quaternion.Euler(0,0, z);
this.transform.rotation = rot;
//Retorna um float de -1.0 ate 1.0
// Input.GetAxis("Vertical");
//Move a Nave
Vector3 pos = this.transform.position;
//Input.GetAxis("Vertical");
Vector3 velocity = new Vector3(Input.acceleration.x , maxSpeed * (Input.acceleration.y ) * Time.deltaTime, 0);
pos +=rot * velocity;
我的玩家在加速度计中移动,但是射击目标总是向上(没有到达来自侧面的敌人),因为当我点击移动屏幕(触摸)时,玩家被旋转到你点击了吗?