Unity_2D_Introduction icon indicating copy to clipboard operation
Unity_2D_Introduction copied to clipboard

Changed Input function from fixedUpdate to Update

Open negiyosai opened this issue 6 years ago • 1 comments

Always add Input functions in Update and Physics functions in FixedUpdate. Also getting raw axis value can lead to laggy perfomances in lower ended devices.

negiyosai avatar Oct 01 '19 14:10 negiyosai

Hey! Sorry for the late response, I have never gotten a pull request before and so don't check my github very often.

So about the PR, I am fine with moving the Inputs to Update() instead of FixedUpdate(), however the purpose of .GetAxisRaw() is to get rid of the ramp-up time and make movement instantaneous.

If you still intend on modifying .GetAxisRaw() to something else that has better performance and also performs the same functionality, then I would also ask that you update the Wiki tutorial to match the new changes.

Also, based on how it is written, I believe you'd have errors because of variable scoping, right? If i'm not mistaken, the variables you define in Update() won't be available for use in FixedUpdate().

dnorth avatar Oct 17 '19 16:10 dnorth