The Same Declaration in Different Classes?

I wanna breakdown my script into shorter portion, for better readability and organized. Not sure if this would affect the performance.

But I have an instance in the LateUpdate() function, specifically rightX = Input.GetAxis("RightStickX"); and other similiar instances that I want to use in different classes.

I know that I could declare and initialize the same instance, also I could use a new instance by declaring it from the other class. I have a feeling that they still consume more memory as I make more classes that use the same instance.

My question is, is there a way to use the same object since the float value that I get here is the same all around? Or should I just use Input.GetAxis() without instantiating it?

P.S. I’m following tutorial, not sure why Input.GetAxis() is instantiated in the first place. Would love to know if there’s any use other than, maybe making it easier to type?

I am not sure what you mean with Input.GetAxis getting instantiated. Nothing gets instantiated there, it just gets a float value of the specified axis. You can perfectly fine use Input.GetAxis multiple places. Or you can make your rightX value public and reference it in your other scripts.