Ok… I’ve just tried out the Xinput wrapper for Unity and I’ve noticed something that kinda bugs me.
This code sets up Player One’s Controller
public static void Update () {
state = GamePad.GetState(PlayerIndex.One, GamePadDeadZone.None);
}
this is just a simple initialization code, however its assigning a variable ever frame, the same variable to the same thing every frame. this code isn’t working in Start or Awake(it gets assigned but the input is completely ignored), most of us would like to keep initialization away from repeating calls like Update.
Why does this code require to be called on each frame? Why does Input get ignored if i Use it otherwise? if I am ignorant of how the code works please enlighten me.