Input.GetAxis("Horizontal")

Hi,

Input.GetAxis("Horizontal")

Is Input a static class?
Because I call the GetAxis method without instantiating the class.

Or is it something else?

In the Unity Scripting documentation it says:
Input
class in UnityEngine
Implemented in:UnityEngine.CoreModule
Description
Interface into the Input system.

And you cant write this:
transform.position.y = transform.position.y + 0.1f * vertical;

it gives me an error msg. tranform.position is not a variable. What is it then?
Is it a pointer?

Yes, Input is a static class, however, a class doesn’t need to be static to reference a field/method without instantiating it - the field/method just needs to be static.
IE: GetAxis() is a static method.

As for your other issue, you cannot modify the individual x, y, and z values of a Vector3/2. You’ll need to create a new Vector3/2 with the desired values instead.

1 Like

thank you