Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

C# Camera.main.ScreenPointToRay on android

$
0
0
I need to convert this from Javacript to C#, but it doesn't seem to work... var ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Input.GetMouseButtonDown (0)) { if (Physics.Raycast (ray, hit, 100)) { if (! selectedCard) { DoSomething(); } } } Works perfectly on both Windows AND Android. But when i convert this to C#, it only works on Windows.... Android Input's are not recognized... Why is that? What do i have to do to get this working? ray = Camera.main.ScreenPointToRay (Input.mousePosition); if (Input.GetMouseButtonDown (0)) { if (Physics.Raycast (ray, out hit, 100)) { if (! selectedCard){ DoSomething(); } } }

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>