Unity 2023.2: Introduction to 2D: Part 6: Input Manager and Moving Sprites

Опубликовано: 30 Сентябрь 2024
на канале: Dan Cox
29
1

This video demonstrates how the Input Manager creates categories of input such as "Horizontal" and "Vertical" in a range of -1 to 1. By setting a consistent speed, we can move a sprite in Unity. However, there is a small problem: in trying to render frames at a constant number, there are changes in time per frame. By using Time.deltaTime, we can multiply this fraction of a second, if it occurs, to the input and speed. This creates a smooth movement for the sprite.

Unity 2023.2: Introduction to 2D Playlist:    • Unity 2023.2: Introduction to 2D  

Created by Dan Cox ( @DanCox )