google-ar / arcore-unity-sdk

ARCore SDK for Unity
https://developers.google.com/ar
Other
1.4k stars 400 forks source link

Hey guys... How can we detect the host and resolver in google cloud anchor???? I have been using raycast but it doesnot seen to work out. #743

Open manhiem opened 4 years ago

manhiem commented 4 years ago

Ray raycast = fpsCam.ScreenPointToRay(touch.position); RaycastHit hit; Gizmos.color = Color.red; Vector3 direction = transform.TransformDirection(Vector3.forward) * 5;

    if(Physics.Raycast(raycast, out hit))
    {
        Gizmos.DrawRay(transform.position, direction);
        if(hit.collider.name == "PlayerTag")
        {
            target.TakeDamage(damage);
            text.text = "Hit";
        }
    }

//not working...