如下代码:
Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0));
RaycastHit hitInfo;
bool isCollider = Physics.Raycast(ray, out hitInfo);
我想做一个在屏幕中点的射线检测,但现在的代码在PC中运行可以实现,在移动端却不行 获得的点不是中心点。我用的是Google vr sdk。有哪位大神可以帮忙实现一下么?或者告诉我怎样在Google vr 中加入普通的蓝牙手柄也行······
屏幕中心点坐标:Vector2 screenCenter = new Vector2(Screen.width/2,Screen.height/2);
不是啊,这样到移动端后会出现不准确的问题,在移动端获取的点并不是中心点