How can steerRotation be a float if we're inputting a literal string

float steerRotation = Input.GetAxis (“Horizontal”)
transform.Rotate( 0, 0, -steerRotation );

How can steerRotation be a float if we’re inputting a literal string.
Horizontal Input Manager has a lot of different values, which ones are they using?

Because the return type of Input.GetAxis() is a float. The return type isn’t set by its input type.

The one you tell it to use, in this case, “Horizontal”

Does that all make sense?

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms