Road kill + sound effects

This commit is contained in:
magn9775
2024-04-20 15:02:09 +02:00
parent 2ceb18470b
commit 601de22cfa
18 changed files with 536 additions and 103 deletions

View File

@@ -12,6 +12,8 @@ public class carcontrolv2 : MonoBehaviour
public float autoBrake;
public AudioSource audio;
WheelControl[] wheels;
public Rigidbody rigidBody;
@@ -107,4 +109,13 @@ public class carcontrolv2 : MonoBehaviour
}
}
}
private void OnCollisionEnter(Collision other) {
if (other.gameObject.tag == "Wall")
{
audio.Play();
}
}
}