Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using TMPro;
- public class PlayerController : MonoBehaviour
- {
- [SerializeField] float speed;
- //RPM
- [SerializeField] TextMeshProUGUI rpmText;
- [SerializeField] float rpm;
- void FixedUpdate()
- {
- //rpm
- rpm = Mathf.Round((speed % 30) * 40);
- rpmText.SetText("RPM: " + rpm);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement