I want to move my play using the position of the touch on the screen as shown in that picture I was doing this private int splitScreenX = Screen.width / 2;
private int splitScreenY = Screen.height / 2;
with this and using Input.GetMouseButtonDown(0)
here is the whole code
private int splitScreenY = Screen.height / 2;
private int splitScreenX = Screen.width / 2;
void Update()
{
RunModeInput();
}
void RunModeInput()
{
if (Input.GetMouseButtonUp(0))
{
if (InputManger.Instance.isStarted)
{
if (!InputManger.Instance.StartRun)
{
InputManger.Instance.StartRun = true;
}
if (Input.mousePosition.y >= splitScreenY && Input.mousePosition.x <= splitScreenX)
{
InputManger.Instance.Jump = true;
}
else if (Input.mousePosition.y < splitScreenY && Input.mousePosition.x <= splitScreenX)
{
InputManger.Instance.Slide = true;
StartCoroutine(TurnOff_Slide(0.2f));
}
else if (Input.mousePosition.x > splitScreenX)
{
InputManger.Instance.Dash = true;
}
}
}
else
{
InputManger.Instance.Jump = false;
InputManger.Instance.Dash = false;
InputManger.Instance.Slide = false;
}
}
But now i am switching my game to a new input system since I have changed my plan to release this game just for my phone, now I also my to publish my game for Desktop. how can i do the same thing using a new input system?