- Home /
Trying to understand fingerId's - android c#
Hello
I'm making a multiplayer game in which I will have up to 4 people touching the screen at the same time
Right now I have it so that when one person touches their designated area, an object is instantiated, follows their finger, and is sent in the deltaPosition.normalized direction when the swipe is finished.
The problem I have right now is that if another finger is pressed to the screen before player1 "fires" their object, that object will just to the newly placed finger.
I'm tracking finger01 with this
for (int i = 0; i < Input.touchCount; i++)
{
ray = camera.ScreenPointToRay(Input.GetTouch(i).position);
}
and simply transforming the cloned object via that position, ie
if(holding)
clone.transform.position = new Vector3(GameManager.hit.point.x, GameManager.hit.point.y, GameManager.hit.point.z);
this works great, unless someone else presses a finger to the screen
how can I make an instantiated object follow a fingerID? ** I don't understand how fingerID's work
thanks for any help