Hello, I’m new to Unity and currently I’m learning the basics of the editor and scripting. I have learned multiple ways of handling inputs:
OnMouseDown() - OnMouseDrag()
Input.GetMouseButtonDown()
Using axis in input manager then use Input.GetAxis() in script.
So, What is the difference between all that ? Is a certain approach better than others? . Also I have read that there is a package called ( Input System Package) but I haven’t used it yet. Is it better than all other methods of handling inputs ?
Hi, I would recommend to start using Input.GetKeyDown(), because to my it´s the easiest way of handling basic inputs. The Input.GetAxis() way is more structured and allows easier support for different input devises. Like providing the abillity to use a gamepad or keyboard and mouse. The “Input System Package” is basicly the new version of the other systems. It´s more clear and offers more opportunities.
So to close things up i would say start using Input.GetKeyDown() and if you´re more used to Unity you should give the “new Input system” a look.