예제 #1
0
파일: Gun.cs 프로젝트: nick55660711/VR
    public void shoot()
    {
        GameObject BulletAll;

        BulletAll = Instantiate(bullet, GunPoint.position, GunPoint.rotation);
        BulletAll.GetComponent <Rigidbody>().AddForce(transform.forward * 1000);
        BulletAll.GetComponent <Rigidbody>().AddForce(transform.up * 70, ForceMode.Force);
        Destroy(BulletAll, 5);
    }
예제 #2
0
파일: Gun.cs 프로젝트: nick55660711/VR
 private void Update()
 {
     if (Input.GetKeyDown("t"))
     {
         GameObject BulletAll;
         BulletAll = Instantiate(bullet, GunPoint.position, GunPoint.rotation);
         BulletAll.GetComponent <Rigidbody>().AddForce(transform.forward * 2000);
         BulletAll.GetComponent <Rigidbody>().AddForce(transform.up * 70, ForceMode.Force);
     }
 }