Pierre Angelo

Generation

generate functionWed, 05 Apr 2023

¿Cómo mostrar por pantalla el tiempo transcurrido en unity?

using UnityEngine; using System.Collections; public class PrintTime : MonoBehaviour { private float startTime; void Start() { startTime = Time.time; } void Update() { if (Input.GetKeyDown(KeyCode.Space)) { float time = Time.time - startTime; print("Time: " + time); } } }

Questions about programming?Chat with your personal AI assistant