Introducci贸n
Bienvenida al curso
Introducci贸n a los Scripts en Unity: Ciclo de vida y m茅todos
OnDisable, OnDestroy, OnMouseDown
Usando la consola de una forma muy pro
Propiedades p煤blicas y privadas, [SerializeField], [Header] y [HideInInspector]
Clases serializables
Causar cambios
El componente transform y los vectores
Manipulando al componente Transform
Manipulando al componente Transform: rotaci贸n y escala
Manipulando al componente Transform: vectores direccionales
Interpolaciones
Tiempo
Tiempo en Unity
Contando el tiempo: tiempo total y tiempo delta
Movimiento y tiempo
Creando movimiento independiente del framerate
Interacci贸n
GameObjects que responden a su entorno
Leyendo al jugador (teclado)
Leyendo al jugador (teclado y gamepad)
Comunicaci贸n
Encontrando componentes
Hijos y padres
Comunicaci贸n telep谩tica: eventos
Arquitectura
Inicializando variables
Configuraci贸n, Informaci贸n e Inicializaci贸n
Cierre
Despedida del curso
You don't have access to this class
Keep learning! Join and start boosting your career
The development of a video game requires understanding how the frame rate works, since it is fundamental to ensure a fluid movement of the objects on screen. The frame rate is the amount of images that are rendered per second and is vital to the user experience. If your code depends on the frame rate, you may face problems when system resources are limited.
A lag script simulates a slow computer, allowing us to observe how the game would behave under different performance conditions. By adjusting this script, we get the computer to pretend to have a low frame rate, thus evaluating how independent our code is of this factor.
To understand the impact of frame rate on object movement, it is important to know how to use delta time
in Unity. The difference between moving an object using or not using delta time
is crucial to ensure a constant movement regardless of system resources.
When moving an object without delta time
, the movement is done per frame. This means that the distance traveled depends directly on the frame rate:
public class SinDeltaTime : MonoBehaviour{ public float speed = 0.05f; // 5 centimeters per frame
void Update() { transform.Translate(0, 0, speed); }}
Using delta time
ensures that the space traveled by an object is constant per second, not per frame, regardless of the frame rate:
{public class ConDeltaTime : MonoBehaviour{ public float speed = 5f; // 5 meters per second
void Update() { transform.Translate(0, 0, speed * Time.deltaTime); }}
Understanding the theoretical underpinnings behind motion through delta time
is essential, not only because it improves game development, but also because it applies to scaling, growth and many other aspects of programming and animation in Unity.
Through these concepts, we not only develop skills to create a game, but strengthen the understanding necessary to innovate and create without relying on pre-existing guidelines or examples. The theoretical knowledge equips you to see beyond and confidently build any mechanic in a virtual environment.
Contributions 10
Questions 0
ocupe el mismo numero 6.5
Excelente explicaci贸n y el atajo de teclado fue la cereza del pastel. Gracias! 馃
el numero que con el que me va a 10 fps es 6.34
tambien me dio 6,5
Excelente concejo ya que he hecho algunos tutoriales pero vale mas entender como hacerlo
Want to see more contributions, questions and answers from the community?