unity3d - Finger Touch instead of First Person Character -


Probably very easy but ..... this script is working well, it is from Boris Media When it shows a text entered in the character box collider, I do not use characters that I am using a 3D model so that the user must touch the model, should not run through the game. thank you in advanced.

  #pragma strict var Note: GameAbject; Start function () {note.SetActive (wrong); } Function OnTriggerEnter () {note.SetActive (true); } Function OnTriggerExit () {note.SetActive (false); }  

Here is an example in C # , but If you need it then there can be no difficulty in converting to javascript :

  vector 2 touchposs = input. Gatecht (0). Legislation; Ray ray = camera. ScreenpointTorai (new vector 3 (Touchpos.ex, touch.p.a., 0)); Reit Hit Hit; If (Physics. Recast (ray, out hit)) // The user's touch has collided with some, now we have to see who collided with it. You can also use hit points if you want to get touch status in the world (hit.collider.tag == "GameObjectTag") {Debug.Log ("Hit" + hit.collider.name); Hit.collider.gameObject.setActive (true); }}  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -