take and hold item

hi, i wan to know the coding in c# on how to have a character(cube) go to another cube and press 'e' key to hold the cube on top of the character and move around and press e key again to release the cube...thx..

You could use a ray cast or trigger area in front of the character to determine what is in front of him

then use tags to determine if that object is pickupable (did I just invent a word?)

to pickup the object just set a property on your character to that object, then on update you can reposition the object above the character.

You can check this Post in the Unity Forum. The "throwsomething_804" is something which you are looking for. Link