Crossplatform Input Controller made Easy!

Edward Kim
2 min readMay 23, 2021

Going to be another short article but this will be about the simple method to adding basic touch controls to your game!

First off we will be using “CrossplatformInput” from the Standard Assets package on the Unity Store. This is now outdated, however we can still use what we need.

What we end up needing to do is simply find our prefab and just drag it into the hierarchy (after replacing the image associated first of course)! Now its time to get to some coding.

First we cannot forget to add the CrossPlatformInput library. Afterwards it is as simple as instead of using Input.GetKeyDown or Axis, we use “CrossPlatformInputManager.GetAxis” and “GetButtonDown”.

With that we have working touch controls that we can test in the editor! If I were to make touch controls from scratch, that would be an enormous task that I am definitely not ready for. It is great that the store has assets like this to make things a little easier!

See you next post!

--

--