|
@@ -250,7 +250,7 @@ public class Player : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public float fidgetSpin = 200.0f;
|
|
|
|
|
|
|
+ public float fidgetSpin = 30.0f;
|
|
|
|
|
|
|
|
int bulletCounter = 5;
|
|
int bulletCounter = 5;
|
|
|
private void Shoot()
|
|
private void Shoot()
|
|
@@ -258,8 +258,8 @@ public class Player : MonoBehaviour
|
|
|
var rb = Instantiate<Rigidbody>(bulletPrefab);
|
|
var rb = Instantiate<Rigidbody>(bulletPrefab);
|
|
|
rb.transform.position = gunTransform.position;
|
|
rb.transform.position = gunTransform.position;
|
|
|
rb.transform.forward = gunTransform.forward;
|
|
rb.transform.forward = gunTransform.forward;
|
|
|
- // rb.maxAngularVelocity = fidgetSpin;
|
|
|
|
|
- // rb.AddTorque(transform.up * fidgetSpin, ForceMode.VelocityChange);
|
|
|
|
|
|
|
+ rb.maxAngularVelocity = 300;
|
|
|
|
|
+ rb.AddTorque(transform.up * fidgetSpin, ForceMode.VelocityChange);
|
|
|
rb.AddForce(bulletForce * (transform.forward + Vector3.up * bulletUpBias), ForceMode.VelocityChange);
|
|
rb.AddForce(bulletForce * (transform.forward + Vector3.up * bulletUpBias), ForceMode.VelocityChange);
|
|
|
Destroy(rb.gameObject, 2f);
|
|
Destroy(rb.gameObject, 2f);
|
|
|
if (bulletCounter == 5)
|
|
if (bulletCounter == 5)
|