How to hold and move a object using other object?

Dear Community,
I am just a beginner to unity3d version 5 and i was thinking how can i hold, (move and drop )a object say a box or a sphere using another object say a hand or grabbing tool with the appropriate meshes added to both the objects.Any help is welcomed!!

Thanks

1st Try to drag an Object with your mouse position by converting Screen Position received by Input.mousePosition to World position by Camera.ScreenToWorldPosition. search this one or two functions.

Now take this object you are dragging as your mouse position and do the same thing for other Object.
If you try the 1st thing you will have the idea what to do next.
Cheers :slight_smile:

@Yash
Thank you for the answer,will try it and get back.
Cheers!!

Hey I have added 2 Script to Complete a full Grab toggle and ready to move code,

Fixed An Inversion Error and a Euler read error while moving. since yesterday it is now working as stated below

ObjectReplyIdAndLock, ObjectGrabIdAndMove

ObjectGrabIdAndLock goes on Main player,… ObjectReplyIdAndMove goes on Moveable Objects remember to add layers in you want to hit in inspector and pick the Headcam Ect

Updated Scripts Since the other week now with full movement And Rotation and Full Inversion Options

This is Complete bar Diagnals and Mouse Rotation as im adding this now, you want to use the option OverideDiagnals and possibly UseDefaultRotation if u hate my defualt.

too add mouse copy the whole auto inversion and paste it underneath and swap the names to the mouse names instead of the default keys its a mission dont attempt it lol. i will do this over the week as still cleaing up the script its pretty large, Please contact at Exvalid@gmail.com To give me job coding.

cheers Ryan kappeslink text Exvalid@gmail.com
[105511-objectgrabscripts.zip|105511]