Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

touch is not working

$
0
0
in my game i have 4 scene ,one of them is may mainmenu i have some keys in this scene so i write a code that is= if (Input.touchCount > 0) { var ray = Camera.main.ScreenPointToRay (Input.GetTouch(0).position); var hit : RaycastHit; if (Physics.Raycast (ray, hit)) { Debug.Log(" You just hit " + hit.collider.gameObject.name); if(hit.collider.tag == "newGame") { Application.LoadLevel(2); } if(hit.collider.tag == "guide") { Application.LoadLevel(5); } if(hit.collider.tag == "aboutme") { Application.LoadLevel(4); } } } to use touche and it work very well in my mainMenu but when i write this code for my another scene it not working and always it get Eror that is =Objetc reference not set to an instance of an object) and if i had some mistakes in may question its for that i cant write english well please help me..i realy need this

Viewing all articles
Browse latest Browse all 1875

Trending Articles



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