I am new in Unity3d. I am making a 3d game. In this game I would like to be able to drag and drop an object.
I have a youtube link. It’s about 1 minute. This video presents what I want to do exactly.
Link: River Crossing IQ Logic 8 answer - YouTube
Please help me solve this problem.
void OnMouseDrag(){
FLOAT DISTANSE=10F;
Vector3 mouseposition = new Vector3 (Input.mousePosition.x, Input.mousePosition.y, distance);
Vector3 objectposition = Camera.main.ScreenToWorldPoint(mouseposition);
transform.position = objectposition;
}
//attach this script to the object that what you need to drag.
Thanks Veerababu.g’s… But it does not working for me… I humbly request you to please visit the link that I have share in question block, You can deeply and clearly understand my actual problem.