Reading the same Input from multiple Scripts

Hey ,

I seem to have a problem with reading the inputs in NewInput System. I have set up an ActionMap.

and wrote this code to be able to read this input. My problem is, i want to read the same input from another script as well. I have done everything the same in the other script. but the inputs will not be registered there.

Controls control;

void Awake(){

control = new Controls();

controls.Player.Turn.canceled += ctx => moveNew = Vector2.zero;
        controls.Player.Turn.performed += ctx => moveNew = ctx.ReadValue<Vector2>();
}

So i copy pasted this section to another script. But i couldnt read the inputs. However and this is really interesting for me, because i am allowing both input systems in the project i tried to read the inputs through GetAxis method (old version) and this time the new Input System couldnt register anything at all. This is something extra but i would appreciate a bit of insight to this topic . I hoped that i made my problem clear.

I know i could hold a reference to the previous scipt and read the input from a property of that script. Actually i ve been doing that so far. But still i want to learn if there is a way to read the same input from different locations.

I use an intermediate input layer as the next video, and i have no problems with reading inputs from diff scrips.

Actually, you use this layer to catch the inputs, and then fire events you use in your scripts.
Hope it helps you.

1 Like

i will definitely give it a try thanks a lot