Simple Player Movement In Unity

Corey Daniely
1 min readMay 25, 2023

--

#SoftwareDevelopment #2D #Unity

To understand simple player movement in Unity you first have to understand how update is working. Update is called once per frame typically about 60 frames per second. (Vector 3.right) is equivalent to typing new Vector3(1, 0, 0). When we say one unit in unity that’s the equivalent of one meter in the real world. What’s happening here is were moving our player to the right one meter per frame 60 meters per second. In order to move the player one meter per second you have to convert one per frame to one meter per frame. To do this you have to incorporate real time by multiplying the Vector by (*) Time.deltaTime. Time.deltaTime is going to do the conversion process from frame rate dependant to real minute seconds and hours for us. Time.deltaTime can be thought of as one second. The technical term for Time.deltaTime is really the time in seconds it took to complete the last frame to the current frame.

--

--

Corey Daniely
Corey Daniely

Written by Corey Daniely

0 Followers

Unity Developer

No responses yet