子弹向右发射没问题,可是向左发射的时候,虽然是在左面的位置发射,但方向还是朝右,请问下如何修改子弹的朝向?代码是:
void Update (){
playerMovie pm2 = new playerMovie ();
bool right2 = pm2.chaoxiang;
if (Input.GetKeyDown(KeyCode.C)) {
if(right2 == true){
GameObject projectile = (GameObject)Instantiate(bullet1,transform.position + transform.forward * -0.8f, Quaternion.identity);
nextFire = Time.time + fireRate;
}
}
}
void Update (){
playerMovie pm2 = new playerMovie ();
bool right2 = pm2.chaoxiang;
if (Input.GetKeyDown(KeyCode.C)) {
if(right2 == true){
GameObject projectile = (GameObject)Instantiate(bullet1,transform.position + transform.forward * -0.8f, Quaternion.identity);
nextFire = Time.time + fireRate;
}
}
}