- Home /
Getting controller input: Update of FixedUpdate (and why)?
Hey there, I need a little help on this one. It is clear to me that every action that involves physics in its execution should be called inside FixedUpdate, but what about gathering input data required to perform those?
Should I gather it inside Update and then pass the values to FixedUpdate or maybe forget about Update and go for Fixed entirely in this case?
I'm a total beginner and I'm following the Tanks! tutorial at the moment, where the first approach is implemented and I would simply like to know what are the consequences (including potential drawbacks).
If I get it right, it may cause some problems (when framerate varies/is very low or very high) with controller responsiveness, since FixedUpdate could call the same method (e.g. MovePosition) twice between each Update or just omit it (depending on framerate). Why not check for input every fixed period of time, perform the action immediately and avoid the danger? That's just what I think could happen though and since I'm a newbie I'd like to ask you for a bit of clarification.
Thanks for help, appreciate it a lot!
Your answer
