It "works"

It's a buggy mess but it's a working buggy mess
This commit is contained in:
Pasha Bibko
2025-04-03 13:06:55 +01:00
parent d0de96ae0a
commit 653876e56e
8 changed files with 95 additions and 15 deletions

View File

@@ -1,4 +1,5 @@
using UnityEngine;
using UnityEngine.SceneManagement;
public partial class PlayerMovement : MonoBehaviour
{
@@ -56,6 +57,12 @@ public partial class PlayerMovement : MonoBehaviour
ApplyDrag();
// Displays the speed of the player to the screen
m_SpeedDisplay.text = "Speed: " + new Vector3(m_Body.velocity.x, 0.0f, m_Body.velocity.z).magnitude.ToString("0.00") + " m/s";
m_SpeedDisplay.text = new Vector3(m_Body.velocity.x, 0.0f, m_Body.velocity.z).magnitude.ToString("0.00") + " m/s";
// Reloads the game to stop falling off
if (Input.GetKey(KeyCode.R))
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
}
}