Merge branch 'master' of git@ooftooft.net:Racesm.git
This commit is contained in:
@@ -12,9 +12,15 @@ public class GameUI : MonoBehaviour
|
||||
public GameObject car;
|
||||
private float carVel;
|
||||
public Rigidbody carRB;
|
||||
|
||||
public TextMeshPro speedometer;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
if (speedometer == null)
|
||||
{
|
||||
speedometer = new TextMeshPro();
|
||||
}
|
||||
if (carRB == null)
|
||||
{
|
||||
carRB = GetComponent<Rigidbody>();
|
||||
@@ -25,7 +31,7 @@ public class GameUI : MonoBehaviour
|
||||
void Update()
|
||||
{
|
||||
carVel = (math.abs(carRB.velocity.x) + math.abs(carRB.velocity.y) + math.abs(carRB.velocity.z))*5;
|
||||
print(carVel);
|
||||
|
||||
//print(carVel);
|
||||
speedometer.SetText(carVel.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user