为什么射线检测不到Polygon Collider 2D啊
unity3d吧
全部回复
仅看楼主
level 7
无寒之地 楼主
我要检测到直接改变检测到物体的Shader;但是射线检测不到,是怎么回事啊
2015年12月11日 09点12分 1
level 7
无寒之地 楼主
射线检测部分···,哪里错了?[泪]
2015年12月11日 09点12分 2
level 1
挖个坟, 我也踩坑了, 总结下解决方法:
RaycastHit2D[] hits = Physics2D.RaycastAll(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
也就是需要走Physics2D, 而不是physics, 才能检测到2D collider
2024年04月30日 15点04分 6
1