I wrote this code and from what I know this should work.
I get no errors and no crashing.
??? what gives?
/
/
/
foreach (Touch touch in Input.touches)
{
if (touch.phase == TouchPhase.Began)
{
Ray ray = Camera.main.ScreenPointToRay(touch.position);
RaycastHit hit;
if (Physics.Raycast(ray, out hit) )
{
if (hit.collider.tag == "card")
{
card.transform.rotation = Quaternion.Euler(0, 90, 0);
}
}
}
/
/
/