fix errors

This commit is contained in:
magn9775
2024-04-26 18:31:17 +02:00
parent 2edf1925ca
commit 61d1958308
3 changed files with 153 additions and 17 deletions

View File

@@ -26,6 +26,8 @@ public class GameManager : MonoBehaviour
public GameObject nextCarbtn;
float DNFTimer = 0;
private bool hasCountedDown = false;
private Rigidbody carRB;
void Start()
{
AudioSource backgroundMusic = GameObject.Find("Car Data").GetComponent<AudioSource>();
@@ -96,9 +98,8 @@ public class GameManager : MonoBehaviour
else
{
int checkpointsCollected = player.GetComponent<PlayerController>().checkpointsCollected;
carRB = player.GetComponent<RigidBody>();
carVel = (math.abs(carRB.velocity.x) + math.abs(carRB.velocity.y) + math.abs(carRB.velocity.z))*5;
carRB = player.GetComponent<Rigidbody>();
var carVel = (Mathf.Abs(carRB.velocity.x) + Mathf.Abs(carRB.velocity.y) + Mathf.Abs(carRB.velocity.z))*5;
speedometer.SetText(carVel.ToString());
if (checkpointsCollected == checkpoints.Count())