Question by
Jotunn05 · May 15, 2017 at 10:27 PM ·
androidtouch controlstouch screenmouse click
How to convert Mouse input to touch input for android devices ?
This is my the code I'm using to switch from UI scene to Play scene (it's a simple PONG game and I'm not good at coding).
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Play : MonoBehaviour
{
void OnMOuseDown ()
{
transform.localScale *= 0.9F;
}
void OnMouseUp ()
{
Application.LoadLevel(1);
}
}
1.png
(441.9 kB)
Comment
Answer by Yuzuke · May 16, 2017 at 06:07 AM
I'm not quite sure what your problem is, I mean, why do you want to do that? you're creating a android build, you don't need a mouse!
for android touch input you can check out the API: Input.GetTouch(); and in Unity play mode the mouse click is treated as a finger touch.
and BTW maybe you wanna update your Unity and use Scene$$anonymous$$anager to load your level as well.