I was trying to code touch movement, where the ship moves anywhere your finger moves. I tried this so far, but it doesnt work. I cant test it myself at the moment, because I got no Android Phone near sadly ![]()
void Update () {
for (int i = 0; i < Input.touchCount; ++i)
{
Touch myTouch = Input.GetTouch(i);
if (i == 1)
{
Player.transform.parent = null;
Player_Movement_Point.transform.position = Input.GetTouch(1).position;
Player.transform.parent = Player_Movement_Point.transform;
}
else
{
Player_Movement_Point.transform.position = Input.GetTouch(i).position;
}
}
}
hope you can help me ^^.