fix errors
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user