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
Post a Comment