public class fall : MonoBehaviour
{
float time;
// Update is called once per frame
void Update()
{
time = Mathf.Round(Time.time);
Debug.Log("You are playing since " + time +" seconds.");
}
}
1 Like
Another way to achieve a more readable number is to use formatted strings:
Debug.Log($"Time: {Time.time:0.0}s");
Helpful links:
String Interpolation
String.Format
… or cast it to int :
Debug.Log(“seconds gone :” + (int)Time.time);