How would I go about rigging this? Recently, I began goofing around in Blender and came up with this



Now, I am a beginner and I wanted to rig him to use in unity, and I've been following several tutorials on how to rig characters in general. But the problem is a lot of the time, I end up getting stretching or some pieces of the robot won't follow the other parts, such as the fingers. 

I have succumbed to frustration and have decided to put aside my stubbornness to come here and ask for advice.
First enable the Rigify Addon in Menu: File / User Preferences



Now you can add the whole human rig to your scene in Object Mode Shift-A



In Edit Mode align all bones with your model. When done parent the model to the rig Ctrl-P (With Automatic Weights).



And create the Meta-Rig.



After that you can create Actions and arrange them in the NLA editor. Importing to Unity is best done by Import New Asset from the Asset Menu.

A more detailed description with removal of unneeded bones is available in the Unity documentation: http://docs.unity3d.com/Manual/BlenderAndRigify.html



If you don't want to animate a humanoid then chose Animation Type: Generic  in the import settings of the rig: