i trying to create a game for android and for some reason my character simply will not face left. i’m guessing i need another set of eyes
void TouchInput()
{
if (dead == false && state !="Hold")
{
//touch input
if (Input.GetTouch(0).phase == TouchPhase.Began)
{
startpos = Input.GetTouch(0).position;
}
if (Input.GetTouch(0).phase == TouchPhase.Moved && state != "dashing" && Time.time - dashtimer > 3)
{
if (Input.GetTouch(0).position.x - startpos.x < -3.5f)
{
FL = true;
state = "dashing";
anim.SetBool("Dashing", true);
dashtimer = Time.time + 0.5f;
startpos = transform.position;
}
if(Input.GetTouch(0).position.x - startpos.x > 3.5f)
{
FL = false;
state = "dashing";
anim.SetBool("Dashing", true);
dashtimer = Time.time + 0.5f;
startpos = transform.position;
}
}
if (Input.GetTouch(0).phase == TouchPhase.Began && state == "Grenade Out")
{
RaycastHit hit;
Ray ray = Camera.main.ScreenPointToRay(Input.GetTouch(0).position);
Debug.Log(ray);
if (Physics.Raycast(ray, out hit))
{
Debug.Log(hit);
grenadeTP = hit.point;
}
Debug.Log(grenadeTP.x);
anim.SetInteger("GrenadeS", 3);
grenade = Instantiate(WhatToSpawn[3], WhereToSpawn[3].transform.position, Quaternion.identity) as GameObject;
grenade.transform.parent = null;
timer = Time.time + 1f;
GrenadeOut = false;
state = "NadeT";
}
if (Input.GetTouch (0).phase == TouchPhase.Ended && transform.position.x > startpos.x && state != "dashing")
{
FL = true;
}
if (Input.GetTouch(0).phase == TouchPhase.Ended && startpos.x > transform.position.x && state != "dashing")
{
FL = false;
}
}
}
she’s not pretty but what am i missing?