#if !MOBILE_INPUT usage in example project.

I’m currently studying the standard assets example project, more specifically, the “Character First Person” and throughout the code I’ve see an lot of “#if !MOBILE_INPUT”. Can someone explain to me what this does? I know about #if and all, but I don’t see why it’s so necessary to just check for no mobile input. Thanks in advance :slight_smile:

The Standard Assets include a cross-platform input system that makes it possible to use the assets on pcs, consoles and mobile devices alike. The biggest differences are in the mobile input, so the standard assets have a menu option to turn off mobile input entirely, which in turn set a #define to actually exclude relevant mobile input code from compilation. This is just a simple way of doing it. And yea of course they could just use regular if statements to distinguish between different input methods, but stripping out unneeded code during compilation has better performance and is better to keep code bugfree.