Beginners question about transform.Translate and float values

Hi there,

I have a game object in my scene that I want to travel to the right using the transform.Translate function.

My understanding is that you put float values into the x, y and z parameters of the function in order to make a game object travel a certain distance on the x, y and z axis every frame?

So if I wrote the following in the Update function of a script that is attached to the game object:

void Update(){

   transform.Translate(1f,0,0);

}

Does that mean the game object will travel a distance of 1 float per frame on the X-axis? I believe Unity projects run at a 60fps frame rate so that would mean that the GO would travel 60 floats to the right per second? But what does travelling 1 float actually mean? Does each square that can be seen in the grid in the scene view represent a float value?

Any help would be appreciated.

Hello,

forget about the “1 float”, float is a type, a type use for numbers. data types are not that simple, and you should take a look into c# basics, but think of floats as numbers with decimals.

Second, in unity games dont run at 60fps, they could be running at a higher frame rate, but it is common to cap the fps to 60 (not allways and not necesary)

Third, unity doesnt use “meters” they use “units”, if you use

transform.Translate(1,0,0);

you move in the x axis 1 unit.