Well firstly, why are you using Axis for what seems like an action? Are these to be mapped to two different joysticks?
If this is just horizontal and vertical, then just store it in a Vector2 like someVector2 = new Vector2(Input.GetAxis("Roll1"), Input.GetAxis("Roll2"));
Then you can access the Roll1 value from someVector2.x, and Roll2 from someVector2.y at any point in your code.
Whatever you are doing, what you probably should not do, so tell us what roll1 and roll2 are:
roll = Mathf.max(Input.GetAxis(“Roll1”),Input.GetAxis(“Roll2”));
roll is the movement of the spaceship rolling on it self clock wise or counter clockwise. for this I whant to give 2 diferent set of controle for the same action. so if the left and is busy controlling some other movement you can still roll with your right hand and vice versa.
has I said I found a solution and it work, but is it the best I don’t know.
thanks y’all
I’m not sure how your proposed solution would solve that. If the Left “Roll1” is busy with some other movement, it’s going to have a non-zero value, no? And thus this code is actually going to use its values when that input is being used… So the only time Roll2 is being used now is when Roll1 isn’t being used, kind of defeating the purpose of what you’re suggesting.
What you could do instead is make a class to wrap your inputs in that you can then set parameters on, such as a bool saying the input is being consumed by another action right now so don’t utilize it, and then your code can choose to use a different input.