clear ui samples and fix speedo
This commit is contained in:
1 parent
ba07b6ab49
commit
bc0b39c575
6 files changed
+47
-16
No files matched your search
@@ -4,18 +4,20 @@ public class ShipPhysics : MonoBehaviour {
|
||||
ShipControls ship;
|
||||
|
||||
float maxDmg = 150f;
|
||||
float maxImpulse = 50f;
|
||||
float maxImpulse = 5000f;
|
||||
|
||||
void Awake() {
|
||||
ship = GetComponent<ShipControls>();
|
||||
}
|
||||
|
||||
void OnCollisionEnter(Collision collision) {
|
||||
float totalForce = collision.impulse.magnitude / Time.fixedDeltaTime;
|
||||
|
||||
Debug.Log($"mag {collision.relativeVelocity.magnitude}");
|
||||
Debug.Log($"impulse {collision.impulse} {collision.impulse.magnitude}");
|
||||
Debug.Log($"impulse {collision.impulse} {collision.impulse.magnitude} {totalForce}");
|
||||
|
||||
// if (collision.relativeVelocity.magnitude > maxDmg) {
|
||||
if (collision.impulse.magnitude > maxImpulse) {
|
||||
if (totalForce > maxImpulse) {
|
||||
Debug.Log("Ddddestroyed by" + collision.gameObject.name);
|
||||
ship.Respawn();
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user