Crossplatform Input Controller made Easy!

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!

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Yuriy Ponomarev’s Review

Laravel resizes all images in a folder

Principles and Best Practices in the Software Engineering industry

SOLID Principles

Naming functions and variables

Create a Free Netlify-Gatsby Website With Continuous Deployment

Simple solution structure for Azure Functions & Table Storage

Crafting production-ready Backup as a Service solution using Akka Streams: part 2

Project Risk Management Done Right

Project Risk Management

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Edward Kim

Edward Kim

More from Medium

2.5D Platformer: Moving Platforms

Lerp Squares — Part 2

How to Install the Universal Render Pipeline

Initializing Ads on the Main Menu