Picking up an object and place it in a bag
Hello everyone. I m new in unity3d. I designed a kid room and i have a character (3d person controler) to walk in the room. I want to make the character pick up some objects (one at a time), walk with it to a table and put it down on it. I use arrows for moving the character so i want a key to do the pick up and put down the object. Any help/suggestion? Thanks
I converted your answer to a comment. ;)
Please don't post comments to questions as new answers. This can create confusion
For example if you have a solution click "add your reply". If you want to comment a question or answer or another comment, click "add comment".
Answer by appearance · Feb 01, 2013 at 11:35 AM
You can use colliders and/or Ray casting to decide which object to pick up. You can use any key from keyboard you like to trigger pick-up action. Ex: if (Input.GetButtonDown (KeyCode.Space)) { if (picked-up) { // Already picked-up an object, now we need to put it // Write code here to put it } else { // Select the object to move // You can make this object a child object of player to move along with it... } }