I can’t find a way to check if a certain touch exist script below
"foreach (Touch touch in Input.touches)
{
if (some requierments)
{
follow = true;
followTouch = touch;
}
}"
so my code just make an object follow my touch(I have stored the Touch in a variable ‘touch’)
and once the touch doesn’t exists anymore I want it to go back to his native position(this is the parent’s position ‘transform.parent.transform.position’)
Things I have tried
1)
if (Input.touchCount < 1)
{
//doesn't work because you often have multiple touches
}
if (touch != null)
// but i can't compare a touch value and 'null'
there neither is a touch.exist to use
Questions so what’s a way to check if a touch is ‘alive’ or is there maybe a way to find the index of a touch (while the touch is stored in a variable)