drag imported object in unity3D -


i have basic knowledge of unity , cannot figure out how drag imported object in unity first person controller.

#pragma strict  private var ray:ray; private var hit: raycasthit;   function start()  function update() {     if(input.getmousebutton(0))     {          ray = camera.main.screenpointtoray(input.mouseposition);          if(physics.raycast(ray,hit))         {              if(hit.collider.tag =="draggable")             {                 transform.position.x = hit.point.x;                 transform.position.y=hit.point.y;             }         }     } }  function ontriggerenter (other : collider) {         destroy(other.gameobject);          print("hit");     } 

this script have far works on object has been created in unity. have searched answers objects created in unity.

any appreciated!


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -