LookAt() public method

public LookAt ( Vector3 pos ) : void
pos Vector3
return void
Example #1
0
    void OnTap(TapGesture gesture)
    {
        Ray        ray = Camera.main.ScreenPointToRay(gesture.Position);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit))
        {
            if (dragView)
            {
                dragView.LookAt(hit.point);
            }
            else
            {
                transform.LookAt(hit.point);
            }
        }
    }