Skip to main content

Posts

Showing posts from February, 2020

How to add a Virtual Button in an android game

Simple Steps to add a virtual button an android 1. Download and Import Unity Standard Assets from here...  -For this functionality we only need the CrossPlatformInput and Editor assets. Make sure to import both of them  -Make sure that android is selected in your File>Build settings menu  -Make sure that Mobile Input is Enabled in the Editor 2. Right click in your scene hierarchy and go to UI>Button Step 2  -A canvas and an event system will be created automatically  (If you don't know what these mean, don't worry) 3. Align the button on the canvas according to your liking. Step 3  -Think of the canvas as the screen of the device on which your game is supposed to run on 4. Rename the Button, apply sprites and customize it as per your liking.   - This step is not super important if you just want the functionality. It can be done later on as well 5. Click and Drag the ButtonHandler script from Assets...