I have used Unity’s Standard Assets - Cross Platform Input Control to create Dpad as per my game requirements.
I have following this video tutorial for implementation:
How to move character or game object in Android Top Down Unity game with UI Buttons? Easy tutorial.
I have just imported Cross Platform Input data within the project, as like this only because of other things not useful to me.
Now to move the 2d player character, I have used this code:
horizontalMove = CrossPlatformInputManager.GetAxisRaw("Horizontal");
verticalMove = CrossPlatformInputManager.GetAxisRaw("Vertical");
4 Dpad buttons, I have a setup like this way:
After using the above code to get input for player movement, within Unity Editor, I can able to move my player but within the mobile device, I can’t able to get any values.
For horizontal and vertical both values, I was getting 0 as output.
Now give me some guidance to solve mobile input related solution based on Dpad buttons touch.